Module: Persistence::Object::Complex::Array::ClassInstance
- Defined in:
- lib/persistence/object/complex/array/class_instance.rb
Overview
Class methods for array objects enabled with persistence capabilities.
Instance Method Summary collapse
-
#persist(*args) ⇒ Object
persist #.
Instance Method Details
#persist(*args) ⇒ Object
persist #
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/persistence/object/complex/array/class_instance.rb', line 11 def persist( *args ) index, key, no_key = parse_class_args_for_index_value_no_value( args, true ) if index global_id = index.get_object_id( key ) else global_id = key end object = new object.persistence_id = global_id instance_persistence_bucket.get_object_hash( global_id ).each do |this_key, this_value| if this_value.is_a?( ::Persistence::Object::Complex::ComplexObject ) object.push( this_value.persist ) else object.push( this_value ) end end return object end |