module MongoModel::AttributeMethods::Read

Public Instance Methods

[](name) click to toggle source

Returns the value of the attribute identified by name after it has been typecast (for example, “2004-12-12” in a date property is cast to a date object, like Date.new(2004, 12, 12)). (Alias for read_attribute).

# File lib/mongomodel/concerns/attribute_methods/read.rb, line 22
def [](name)
  read_attribute(name)
end
read_attribute(name) click to toggle source

Returns the value of the attribute identified by name after it has been typecast (for example, “2004-12-12” in a date property is cast to a date object, like Date.new(2004, 12, 12)).

# File lib/mongomodel/concerns/attribute_methods/read.rb, line 15
def read_attribute(name)
  attributes[name.to_sym]
end

Private Instance Methods

attribute(attribute_name) click to toggle source
# File lib/mongomodel/concerns/attribute_methods/read.rb, line 27
def attribute(attribute_name)
  read_attribute(attribute_name)
end