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.
178 179 180 181 |
# File 'lib/rufus/sixjo.rb', line 178 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
183 184 185 186 187 188 189 |
# File 'lib/rufus/sixjo.rb', line 183 def method_missing (m, *args) l = @locals[m.to_sym] return l if l != nil @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
195 196 197 |
# File 'lib/rufus/sixjo.rb', line 195 def get_binding binding end |