Class: Yoda::Store::Query::Associators::AssociateAncestors
- Inherits:
-
Object
- Object
- Yoda::Store::Query::Associators::AssociateAncestors
- Defined in:
- lib/yoda/store/query/associators/associate_ancestors.rb
Defined Under Namespace
Classes: CircularReferenceError, Processor
Instance Attribute Summary collapse
- #registry ⇒ Registry readonly
Instance Method Summary collapse
- #associate(obj) ⇒ Enumerator<Objects::NamespaceObject>
-
#initialize(registry) ⇒ AssociateAncestors
constructor
A new instance of AssociateAncestors.
Constructor Details
#initialize(registry) ⇒ AssociateAncestors
Returns a new instance of AssociateAncestors.
19 20 21 |
# File 'lib/yoda/store/query/associators/associate_ancestors.rb', line 19 def initialize(registry) @registry = registry end |
Instance Attribute Details
#registry ⇒ Registry (readonly)
16 17 18 |
# File 'lib/yoda/store/query/associators/associate_ancestors.rb', line 16 def registry @registry end |
Instance Method Details
#associate(obj) ⇒ Enumerator<Objects::NamespaceObject>
25 26 27 28 29 30 31 32 33 |
# File 'lib/yoda/store/query/associators/associate_ancestors.rb', line 25 def associate(obj) if obj.is_a?(Objects::NamespaceObject) Enumerator.new do |yielder| Processor.new(registry).process(obj).each { |klass| yielder << klass } end else [] end end |