Class: Perennial::Generator::HashBinding
- Defined in:
- lib/perennial/generator.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ HashBinding
constructor
A new instance of HashBinding.
- #to_binding ⇒ Object
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_binding ⇒ Object
15 16 17 |
# File 'lib/perennial/generator.rb', line 15 def to_binding return binding() end |