Class: ERB::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/erb/context.rb

Instance Method Summary collapse

Constructor Details

#initialize(vars) ⇒ Context


Wraps any data you wish to send to ERB limiting it’s context access.




15
16
17
18
19
# File 'lib/erb/context.rb', line 15

def initialize(vars)
  vars.each do |key, val|
    instance_variable_set("@#{key}", val)
  end
end

Instance Method Details

#_bindingObject


Returns the binding so that we can ship it off and give it to ERB.




25
26
27
# File 'lib/erb/context.rb', line 25

def _binding
  return binding
end