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.



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_bindingObject

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