Class: Array
Overview
Constant Summary
ODBA::Persistable::Exact, ODBA::Persistable::Find, ODBA::Persistable::ODBA_EXCLUDE_VARS, ODBA::Persistable::ODBA_INDEXABLE, ODBA::Persistable::ODBA_PREDEFINE_EXCLUDE_VARS, ODBA::Persistable::ODBA_PREDEFINE_SERIALIZABLE, ODBA::Persistable::ODBA_PREFETCH, ODBA::Persistable::ODBA_SERIALIZABLE
Instance Attribute Summary
#odba_id, #odba_name, #odba_persistent, #odba_prefetch
Instance Method Summary
collapse
append_features, #dup, #eql?, #odba_add_observer, #odba_delete, #odba_delete_observer, #odba_delete_observers, #odba_dup, #odba_exclude_vars, #odba_indexable?, #odba_isolated_dump, #odba_isolated_store, #odba_isolated_stub, #odba_isolated_twin, #odba_notify_observers, #odba_observers, #odba_potentials, #odba_replace_stubs, #odba_serializables, #odba_snapshot, #odba_store, #odba_store_unsaved, #odba_take_snapshot, sanitize
Instance Method Details
153
154
155
|
# File 'lib/odba/stub.rb', line 153
def &(other)
_odba_amp(other.odba_instance)
end
|
157
158
159
|
# File 'lib/odba/stub.rb', line 157
def +(other)
_odba_plus(other.odba_instance)
end
|
161
162
163
|
# File 'lib/odba/stub.rb', line 161
def -(other)
_odba_minus(other.odba_instance)
end
|
#<=>(other) ⇒ Object
165
166
167
|
# File 'lib/odba/stub.rb', line 165
def <=>(other)
_odba_weight(other.odba_instance)
end
|
#==(other) ⇒ Object
169
170
171
|
# File 'lib/odba/stub.rb', line 169
def ==(other)
_odba_equal?(other.odba_instance)
end
|
#_odba_amp ⇒ Object
152
|
# File 'lib/odba/stub.rb', line 152
alias_method :_odba_amp, :&
|
#_odba_equal? ⇒ Object
168
|
# File 'lib/odba/stub.rb', line 168
alias_method :_odba_equal?, :==
|
#_odba_minus ⇒ Object
160
|
# File 'lib/odba/stub.rb', line 160
alias_method :_odba_minus, :-
|
#_odba_plus ⇒ Object
156
|
# File 'lib/odba/stub.rb', line 156
alias_method :_odba_plus, :+
|
#_odba_union ⇒ Object
172
|
# File 'lib/odba/stub.rb', line 172
alias_method :_odba_union, :|
|
#_odba_weight ⇒ Object
164
|
# File 'lib/odba/stub.rb', line 164
alias_method :_odba_weight, :<=>
|
#odba_collection ⇒ Object
512
513
514
515
516
517
518
|
# File 'lib/odba/persistable.rb', line 512
def odba_collection
coll = []
each_with_index { |item, index|
coll.push([index, item])
}
coll
end
|
#odba_cut_connection(remove_object) ⇒ Object
520
521
522
523
|
# File 'lib/odba/persistable.rb', line 520
def odba_cut_connection(remove_object)
super
delete_if { |val| val.eql?(remove_object) }
end
|
#odba_prefetch? ⇒ Boolean
525
526
527
528
529
530
|
# File 'lib/odba/persistable.rb', line 525
def odba_prefetch?
super || any? { |item|
item.respond_to?(:odba_prefetch?) \
&& item.odba_prefetch?
}
end
|
#odba_replace!(obj) ⇒ Object
532
533
534
535
|
# File 'lib/odba/persistable.rb', line 532
def odba_replace!(obj) super
replace(obj)
end
|
#odba_replace_persistables ⇒ Object
537
538
539
540
|
# File 'lib/odba/persistable.rb', line 537
def odba_replace_persistables
clear
super
end
|
#odba_restore(collection = []) ⇒ Object
542
543
544
545
546
|
# File 'lib/odba/persistable.rb', line 542
def odba_restore(collection = [])
collection.each { |key, val|
self[key] = val
}
end
|
#odba_stubize(obj, opts = {}) ⇒ Object
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
|
# File 'lib/odba/persistable.rb', line 566
def odba_stubize(obj, opts = {}) return false if frozen?
super
if opts[:force]
id = obj.odba_id
collect! do |item|
if item.is_a?(ODBA::Persistable) \
&& !item.is_a?(ODBA::Stub) && item.odba_id == id
ODBA::Stub.new(id, self, obj)
else
item
end
end
true
else
false
end
end
|
#odba_target_ids ⇒ Object
585
586
587
588
589
590
591
592
593
|
# File 'lib/odba/persistable.rb', line 585
def odba_target_ids
ids = super
each { |value|
if value.is_a?(ODBA::Persistable)
ids.push(value.odba_id)
end
}
ids.uniq
end
|
#odba_unsaved?(snapshot_level = nil) ⇒ Boolean
560
561
562
563
564
|
# File 'lib/odba/persistable.rb', line 560
def odba_unsaved?(snapshot_level = nil)
super || (snapshot_level.nil? && any? { |val|
val.is_a?(ODBA::Persistable) && val.odba_unsaved?
})
end
|
#odba_unsaved_neighbors(snapshot_level = nil) ⇒ Object
548
549
550
551
552
553
554
555
556
557
558
|
# File 'lib/odba/persistable.rb', line 548
def odba_unsaved_neighbors(snapshot_level = nil)
unsaved = super
each { |item|
if item.is_a?(ODBA::Persistable) \
&& item.odba_unsaved?(snapshot_level)
unsaved.push(item)
end
}
unsaved
end
|
173
174
175
|
# File 'lib/odba/stub.rb', line 173
def |(other)
_odba_union(other.odba_instance)
end
|