Class: Writefully::Taxon::EagerLoader
- Inherits:
-
Object
- Object
- Writefully::Taxon::EagerLoader
- Defined in:
- lib/writefully/taxon.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#taggings ⇒ Object
readonly
Returns the value of attribute taggings.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #build(*types) ⇒ Object
-
#initialize(klass) ⇒ EagerLoader
constructor
A new instance of EagerLoader.
Constructor Details
#initialize(klass) ⇒ EagerLoader
Returns a new instance of EagerLoader.
39 40 41 42 43 |
# File 'lib/writefully/taxon.rb', line 39 def initialize(klass) @tags = Tag.arel_table @taggings = Tagging.arel_table @resource = klass.arel_table end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
37 38 39 |
# File 'lib/writefully/taxon.rb', line 37 def resource @resource end |
#taggings ⇒ Object (readonly)
Returns the value of attribute taggings.
37 38 39 |
# File 'lib/writefully/taxon.rb', line 37 def taggings @taggings end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
37 38 39 |
# File 'lib/writefully/taxon.rb', line 37 def @tags end |
Instance Method Details
#build(*types) ⇒ Object
45 46 47 |
# File 'lib/writefully/taxon.rb', line 45 def build *types [resource[Arel.star]] << types.map { |type| array_of_taxonomy_hstores_for(type) } end |