Class: WIP::Runner::Renderer::Context
- Inherits:
-
Object
- Object
- WIP::Runner::Renderer::Context
- Includes:
- WIP::Runner::Renderer
- Defined in:
- lib/wip/runner/renderer/context.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context) ⇒ Context
constructor
A new instance of Context.
Methods included from WIP::Runner::Renderer
Constructor Details
#initialize(context) ⇒ Context
Returns a new instance of Context.
11 12 13 14 15 16 17 18 |
# File 'lib/wip/runner/renderer/context.rb', line 11 def initialize(context) context.each do |key, value| if value.is_a?(Module) value = Helper.for(self, value) end self.class.send(:define_method, key.intern, Proc.new { value }) end end |
Class Method Details
.for(context = {}) ⇒ Object
6 7 8 |
# File 'lib/wip/runner/renderer/context.rb', line 6 def for(context = {}) self.new(context).send(:__binding__) end |