Class: Perennial::Generator::HashBinding

Inherits:
Object
  • Object
show all
Defined in:
lib/perennial/generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ HashBinding

Returns a new instance of HashBinding.



11
12
13
# File 'lib/perennial/generator.rb', line 11

def initialize(hash)
  hash.each_pair { |k, v| instance_variable_set("@#{k}", v) }
end

Class Method Details

.for(h) ⇒ Object



19
20
21
# File 'lib/perennial/generator.rb', line 19

def self.for(h)
  new(h).to_binding
end

Instance Method Details

#to_bindingObject



15
16
17
# File 'lib/perennial/generator.rb', line 15

def to_binding
  return binding()
end