Method: Joey::Model.hash_populating_accessor

Defined in:
lib/joey/model.rb

.hash_populating_accessor(method_name, *klass) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/joey/model.rb', line 25

def self.hash_populating_accessor(method_name, *klass)
  define_method "#{method_name}=" do |hash|
    instance_variable_set("@#{method_name}", client.map_data(hash, klass))
  end

  define_method "#{method_name}" do
    instance_variable_get "@#{method_name}"
  end
  #add_creation_method(method_name,klass)
end