Module: ActiveFedora::Aggregation::BaseExtension::ClassMethods
- Defined in:
- lib/active_fedora/aggregation/base_extension.rb
Instance Method Summary collapse
-
#aggregates(name, options = {}) ⇒ Object
Create an aggregation association on the class.
- #create_reflection(macro, name, options, active_fedora) ⇒ Object
-
#filters_association(extending_from, options = {}) ⇒ Object
Create an association filter on the class.
-
#ordered_aggregation(name, options = {}) ⇒ Object
Convenience method for building an ordered aggregation.
-
#orders(name, options = {}) ⇒ Object
Allows ordering of an association.
Instance Method Details
#aggregates(name, options = {}) ⇒ Object
Create an aggregation association on the class
45 46 47 |
# File 'lib/active_fedora/aggregation/base_extension.rb', line 45 def aggregates(name, ={}) Builder.build(self, name, ) end |
#create_reflection(macro, name, options, active_fedora) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/active_fedora/aggregation/base_extension.rb', line 83 def create_reflection(macro, name, , active_fedora) case macro when :aggregation Reflection.new(macro, name, , active_fedora).tap do |reflection| add_reflection name, reflection end when :filter ActiveFedora::Filter::Reflection.new(macro, name, , active_fedora).tap do |reflection| add_reflection name, reflection end when :orders ActiveFedora::Orders::Reflection.new(macro, name, , active_fedora).tap do |reflection| add_reflection name, reflection end else super end end |
#filters_association(extending_from, options = {}) ⇒ Object
Create an association filter on the class
78 79 80 81 |
# File 'lib/active_fedora/aggregation/base_extension.rb', line 78 def filters_association(extending_from, ={}) name = .delete(:as) ActiveFedora::Filter::Builder.build(self, name, .merge(extending_from: extending_from)) end |
#ordered_aggregation(name, options = {}) ⇒ Object
Convenience method for building an ordered aggregation.
67 68 69 |
# File 'lib/active_fedora/aggregation/base_extension.rb', line 67 def ordered_aggregation(name, ={}) ActiveFedora::Orders::AggregationBuilder.build(self, name, ) end |
#orders(name, options = {}) ⇒ Object
Allows ordering of an association
57 58 59 |
# File 'lib/active_fedora/aggregation/base_extension.rb', line 57 def orders(name, ={}) ActiveFedora::Orders::Builder.build(self, name, ) end |