lib/mongoid/attributes.rb
def read_attribute(name)
      normalized = database_field_name(name.to_s)
      if hash_dot_syntax?(normalized)
        attributes.__nested__(normalized)
      else
        attributes[normalized]
      end
    end
# Read a value from the document attributes. If the value does not exist
# it will return nil.
#
# @example Read an attribute.
#   person.read_attribute(:title)
#
# @example Read an attribute (alternate syntax.)
#   person[:title]
#
# @param [ String, Symbol ] name The name of the attribute to get.
#
# @return [ Object ] The value of the attribute.
#
# @since 1.0.0
Read a value from the document attributes. If the value does not exist
it will return nil.
Read a value from the document attributes . If the value does not exist it will return nil .
def read_attribute(name)
      normalized = database_field_name(name.to_s)
      if hash_dot_syntax?(normalized)
        attributes.__nested__(normalized)
      else
        attributes[normalized]
      end
    end
def read_attribute ( name ) normalized = database_field_name ( name . to_s ) if hash_dot_syntax? ( normalized ) attributes . __nested__ ( normalized ) else attributes [ normalized ] end end
Read a value from the document attributes.
Read a value from the document attributes .
The value of the attribute.
The value of the attribute .
 Object 
name
name The name of the attribute to get.
name The name of the attribute to get .
example
Read an attribute. person.read_attribute(:title)
Read an attribute . person . read_attribute ( : title )
example
Read an attribute (alternate syntax.) person[:title]
Read an attribute ( alternate syntax . ) person [ : title ]
since
None