module MongoModel::AttributeMethods::BeforeTypeCast

Public Instance Methods

attributes_before_type_cast() click to toggle source

Returns a hash of attributes before typecasting.

# File lib/mongomodel/concerns/attribute_methods/before_type_cast.rb, line 16
def attributes_before_type_cast
  attributes.keys.inject({}) do |result, key|
    result[key] = attributes.before_type_cast(key)
    result
  end
end
read_attribute_before_type_cast(name) click to toggle source

Returns an attribute value before typecasting.

# File lib/mongomodel/concerns/attribute_methods/before_type_cast.rb, line 11
def read_attribute_before_type_cast(name)
  attributes.before_type_cast(name.to_sym)
end

Private Instance Methods

attribute_before_type_cast(attribute_name) click to toggle source
# File lib/mongomodel/concerns/attribute_methods/before_type_cast.rb, line 24
def attribute_before_type_cast(attribute_name)
  read_attribute_before_type_cast(attribute_name)
end