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.2.11 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.10 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.9 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.8 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.7 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.6 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.5 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.4 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.3 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.2 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.1 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.2.0 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.1.6 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.1.5 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.1.4 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.1.3 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.1.1 lib/mongomodel/concerns/attribute_methods/read.rb
mongomodel-0.1 lib/mongomodel/concerns/attribute_methods/read.rb