Class: WIP::Runner::Renderer::Context
Class Method Summary
collapse
Instance Method Summary
collapse
#asset, #asset_path, #render
Constructor Details
#initialize(context) ⇒ 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
|