Class: Rufus::Sixjo::Erb::Local
- Inherits:
-
Object
- Object
- Rufus::Sixjo::Erb::Local
- Defined in:
- lib/rufus/sixjo.rb
Overview
a local [context] for ERB views
Instance Method Summary collapse
-
#get_binding ⇒ Object
def application; @context.application; end def request; @context.request; end def response; @context.response; end.
-
#initialize(context, locals) ⇒ Local
constructor
A new instance of Local.
- #method_missing(m, *args) ⇒ Object
Constructor Details
#initialize(context, locals) ⇒ Local
Returns a new instance of Local.
198 199 200 201 |
# File 'lib/rufus/sixjo.rb', line 198 def initialize (context, locals) @context = context @locals = locals end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
203 204 205 206 207 208 209 |
# File 'lib/rufus/sixjo.rb', line 203 def method_missing (m, *args) s = m.to_sym return @locals[s] if @locals.has_key?(s) @context.send(m, *args) end |
Instance Method Details
#get_binding ⇒ Object
def application; @context.application; end def request; @context.request; end def response; @context.response; end
215 216 217 |
# File 'lib/rufus/sixjo.rb', line 215 def get_binding binding end |