Module: Wunderbar::SinatraHelpers
- Defined in:
- lib/wunderbar/sinatra.rb
Instance Method Summary collapse
- #_html(*args, &block) ⇒ Object
- #_json(*args, &block) ⇒ Object
- #_text(*args, &block) ⇒ Object
- #_xhtml(*args, &block) ⇒ Object
Instance Method Details
#_html(*args, &block) ⇒ Object
137 138 139 140 141 142 143 144 145 |
# File 'lib/wunderbar/sinatra.rb', line 137 def _html(*args, &block) if block Wunderbar::Template::Html.evaluate('_html', self) do _html(*args) { instance_eval &block } end else Wunderbar::Template::Html.evaluate('_html', self, *args) end end |
#_json(*args, &block) ⇒ Object
161 162 163 |
# File 'lib/wunderbar/sinatra.rb', line 161 def _json(*args, &block) Wunderbar::Template::Json.evaluate('_json', self, *args, &block) end |
#_text(*args, &block) ⇒ Object
165 166 167 |
# File 'lib/wunderbar/sinatra.rb', line 165 def _text(*args, &block) Wunderbar::Template::Text.evaluate('_text', self, *args, &block) end |
#_xhtml(*args, &block) ⇒ Object
147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/wunderbar/sinatra.rb', line 147 def _xhtml(*args, &block) if env['HTTP_ACCEPT'] and not env['HTTP_ACCEPT'].include? 'xhtml' return _html(*args, &block) end if block Wunderbar::Template::Xhtml.evaluate('_xhtml', self) do _xhtml(*args) { instance_eval &block } end else Wunderbar::Template::Xhtml.evaluate('_xhtml', self, *args) end end |