Module: Ramaze::View::Tagz::Methods

Includes:
Tagz
Defined in:
lib/ramaze/view/tagz.rb

Overview

A host of methods useful inside the context of a view including print style methods that output content rather that printing to $stdout.

Instance Method Summary (collapse)

Instance Method Details

- (Object) <<(s) (private)



25
26
27
# File 'lib/ramaze/view/tagz.rb', line 25

def <<(s)
  tagz << s; self
end

- (Object) __(*a) (private)



61
62
63
# File 'lib/ramaze/view/tagz.rb', line 61

def __(*a)
  concat eol
end

- (Object) concat(*a) (private)



29
30
31
# File 'lib/ramaze/view/tagz.rb', line 29

def concat(*a)
  a.each{|s| tagz << s}; self
end

- (Object) eol (private)



53
54
55
56
57
58
59
# File 'lib/ramaze/view/tagz.rb', line 53

def eol
  if response.content_type =~ %r|text/plain|io
    "\n"
  else
    "<br />"
  end
end

- (Object) p(*a) (private)



41
42
43
44
45
# File 'lib/ramaze/view/tagz.rb', line 41

def p(*a)
  a.each do |elem|
    tagz << "#{ Rack::Utils.escape_html elem.inspect }#{ eol }"
  end
end

- (Object) pp(*a) (private)



47
48
49
50
51
# File 'lib/ramaze/view/tagz.rb', line 47

def pp(*a)
  a.each do |elem|
    tagz << "#{ Rack::Utils.escape_html PP.pp(elem, '') }#{ eol }"
  end
end


37
38
39
# File 'lib/ramaze/view/tagz.rb', line 37

def print(*a)
  a.each{|elem| tagz << elem}
end

- (Object) puts(*a) (private)



33
34
35
# File 'lib/ramaze/view/tagz.rb', line 33

def puts(*a)
  a.each{|elem| tagz << "#{ elem.to_s.chomp }#{ eol }"}
end