Sha256: bb510c48ac0426114eca2633553b4a531816ff07197f21b0ebc497b87d9e629e
Contents?: true
Size: 676 Bytes
Versions: 14
Compression:
Stored size: 676 Bytes
Contents
require 'active_support/core_ext/module/delegation' module MongoModel module Attributes class Store < ActiveSupport::OrderedHash include Typecasting include Mongo include Dirty attr_reader :instance delegate :properties, :to => :instance def initialize(instance) super() @instance = instance set_defaults! end def inspect "{#{map { |k, v| "#{k.inspect}=>#{v.inspect}"}.join(', ')}}" end private def set_defaults! properties.each do |name, property| self[name] = property.default(instance) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems