Module: MassiveRecord::ORM::AttributeMethods::Read

Extended by:
ActiveSupport::Concern
Defined in:
lib/massive_record/orm/attribute_methods/read.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#read_attribute(attr_name) ⇒ Object



36
37
38
39
40
41
42
43
44
45
# File 'lib/massive_record/orm/attribute_methods/read.rb', line 36

def read_attribute(attr_name)
  attr_name = attr_name.to_s
  internal_read_method = "_#{attr_name}"

  if respond_to? internal_read_method
    send(internal_read_method)
  else
    decode_attribute(attr_name, @attributes[attr_name])
  end
end