Class: MongoModel::Attributes::Store

Inherits:
ActiveSupport::OrderedHash
  • Object
show all
Includes:
Mongo, Typecasting
Defined in:
lib/mongomodel/attributes/store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mongo

#from_mongo!, #load!, #to_mongo

Methods included from Typecasting

#[]=, #before_type_cast, #has?

Constructor Details

#initialize(instance) ⇒ Store

Returns a new instance of Store.



12
13
14
15
16
# File 'lib/mongomodel/attributes/store.rb', line 12

def initialize(instance)
  super()
  @instance = instance
  set_defaults!
end

Instance Attribute Details

#instanceObject (readonly)

Returns the value of attribute instance.



9
10
11
# File 'lib/mongomodel/attributes/store.rb', line 9

def instance
  @instance
end

Instance Method Details

#inspectObject



18
19
20
# File 'lib/mongomodel/attributes/store.rb', line 18

def inspect
  "{#{map { |k, v| "#{k.inspect}=>#{v.inspect}"}.join(', ')}}"
end