Class: CHBuild::BindableHash

Inherits:
Object
  • Object
show all
Defined in:
lib/chbuild/bindable_hash.rb

Overview

BindableHash is for ERB templates

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ BindableHash

Returns a new instance of BindableHash.



6
7
8
9
10
# File 'lib/chbuild/bindable_hash.rb', line 6

def initialize(hash)
  hash.each do |key, value|
    singleton_class.send(:define_method, key) { value }
  end
end

Instance Method Details

#get_bindingObject

rubocop:disable Style/AccessorMethodName



12
13
14
# File 'lib/chbuild/bindable_hash.rb', line 12

def get_binding # rubocop:disable Style/AccessorMethodName
  binding
end