Sha256: 7117e382162dab66034e355dd73a800ceb9703fa6c646fc3f50894e4a075668c
Contents?: true
Size: 656 Bytes
Versions: 36
Compression:
Stored size: 656 Bytes
Contents
require 'active_support/core_ext/module/delegation' module MongoModel module Attributes class Store < ActiveSupport::OrderedHash include Typecasting include Mongo 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
36 entries across 36 versions & 1 rubygems