Module: Lipa::Web::Helpers::Node
- Included in:
- Node
- Defined in:
- lib/lipa/web/helpers/node.rb
Instance Method Summary collapse
-
#builder(path) ⇒ Object
Assignment template fot xml response.
-
#erb(path) ⇒ Object
Assignment erb template fot html response.
-
#html(opts = nil, &block) ⇒ Object
Definition html response.
-
#json(&block) ⇒ Object
Definition json response.
-
#text(msg) ⇒ Object
Assignment text for html response.
-
#xml(opts = nil, &block) ⇒ Object
Definition xml response.
Instance Method Details
#builder(path) ⇒ Object
Assignment template fot xml response
95 96 97 |
# File 'lib/lipa/web/helpers/node.rb', line 95 def builder(path) { :render => :builder, :template => File.join(root.attrs[:views], path) } end |
#erb(path) ⇒ Object
Assignment erb template fot html response
39 40 41 |
# File 'lib/lipa/web/helpers/node.rb', line 39 def erb(path) { :render => :erb, :template => File.join(root.attrs[:views], path) } end |
#html(opts = nil, &block) ⇒ Object
Definition html response
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/lipa/web/helpers/node.rb', line 59 def html(opts=nil,&block) if block_given? @html = {:block => block} else if opts.nil? @html else @html = opts end end end |
#json(&block) ⇒ Object
Definition json response
78 79 80 81 82 83 84 |
# File 'lib/lipa/web/helpers/node.rb', line 78 def json(&block) if block_given? @json = {:block => block} else @json end end |
#text(msg) ⇒ Object
Assignment text for html response
51 52 53 |
# File 'lib/lipa/web/helpers/node.rb', line 51 def text(msg) { :render => :text, :msg => msg } end |
#xml(opts = nil, &block) ⇒ Object
Definition xml response
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/lipa/web/helpers/node.rb', line 106 def xml(opts=nil, &block) if block_given? @xml = { :block => block } else if opts.nil? @xml else @xml = opts end end end |