Class: Rufus::Sixjo::Erb::Local

Inherits:
Object
  • Object
show all
Defined in:
lib/rufus/sixjo.rb

Overview

a local [context] for ERB views

Instance Method Summary collapse

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_bindingObject

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