Class: Capistrano::Cluster::Packages::DSL::TemplateContext

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/capistrano/cluster/packages.rb

Instance Method Summary collapse

Constructor Details

#initialize(obj, variables = {}) ⇒ TemplateContext

Returns a new instance of TemplateContext.



16
17
18
19
20
21
22
# File 'lib/capistrano/cluster/packages.rb', line 16

def initialize(obj, variables={})
  __setobj__(obj)
  @vars = variables
  variables.each_pair do |name, value|
    class <<self; self;end.send(:define_method,name, &->(){ value })
  end
end