Sha256: 517a8fe641632ef03223136e23d956618420d8191ea4ba05b81243717079c25e

Contents?: true

Size: 876 Bytes

Versions: 38

Compression:

Stored size: 876 Bytes

Contents

module MongoModel
  module AttributeMethods
    module Read
      extend ActiveSupport::Concern
      
      included do
        attribute_method_suffix ""
      end
      
      # 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)).
      def read_attribute(name)
        attributes[name.to_sym]
      end
      
      # Returns the value of the attribute identified by <tt>name</tt> 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).
      def [](name)
        read_attribute(name)
      end
    
    private
      def attribute(attribute_name)
        read_attribute(attribute_name)
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
mongomodel-0.4.3 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.4.2 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.4.1 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.4.0 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.3.6 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.3.5 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.3.4 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.3.3 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.3.2 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.3.1 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.3.0 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.20 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.19 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.18 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.17 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.16 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.15 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.14 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.13 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.12 lib/mongomodel/concerns/attribute_methods/read.rb