Class: Yoda::Store::Objects::Base::Connected
- Inherits:
-
Object
- Object
- Yoda::Store::Objects::Base::Connected
show all
- Extended by:
- ConnectedDelegation
- Defined in:
- lib/yoda/store/objects/base.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
delegate_to_object
Constructor Details
#initialize(object, registry:) ⇒ Connected
Returns a new instance of Connected.
34
35
36
37
|
# File 'lib/yoda/store/objects/base.rb', line 34
def initialize(object, registry:)
@object = object
@registry = registry
end
|
Instance Attribute Details
#object ⇒ Base
24
25
26
|
# File 'lib/yoda/store/objects/base.rb', line 24
def object
@object
end
|
27
28
29
|
# File 'lib/yoda/store/objects/base.rb', line 27
def registry
@registry
end
|
Instance Method Details
#merge(another) ⇒ Object
47
48
49
|
# File 'lib/yoda/store/objects/base.rb', line 47
def merge(another)
object.merge(another).with_connection(**connection_options)
end
|
52
53
54
|
# File 'lib/yoda/store/objects/base.rb', line 52
def meta_class
registry.get(meta_class_address)&.with_connection(**connection_options)
end
|
#with_connection(**kwargs) ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/yoda/store/objects/base.rb', line 39
def with_connection(**kwargs)
if kwargs == connection_options
self
else
object.with_connection(**kwargs)
end
end
|