Module: Makeleaps::Response::HashAccessDelegator

Included in:
MetaInformation
Defined in:
lib/makeleaps/response/hash_access_delegator.rb

Instance Method Summary collapse

Instance Method Details

#delegate_hash_access(hash_name, *method_names) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/makeleaps/response/hash_access_delegator.rb', line 4

def delegate_hash_access(hash_name, *method_names)
  method_names.each do |method|
    define_method(method.to_sym) do
      base_hash = instance_eval(hash_name)
      base_hash[method.to_s]
    end
  end
end