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.
Instance Method Details
#aggregates(name, options = {}) ⇒ Object
Create an aggregation association on the class
31 32 33 |
# File 'lib/active_fedora/aggregation/base_extension.rb', line 31 def aggregates(name, ={}) Builder.build(self, name, ) end |
#create_reflection(macro, name, options, active_fedora) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/active_fedora/aggregation/base_extension.rb', line 47 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 else super end end |
#filters_association(extending_from, options = {}) ⇒ Object
Create an association filter on the class
42 43 44 45 |
# File 'lib/active_fedora/aggregation/base_extension.rb', line 42 def filters_association(extending_from, ={}) name = .delete(:as) ActiveFedora::Filter::Builder.build(self, name, .merge(extending_from: extending_from)) end |