Class: ActiveFedora::Associations::Builder::DirectlyContains
- Inherits:
-
CollectionAssociation
- Object
- Association
- CollectionAssociation
- ActiveFedora::Associations::Builder::DirectlyContains
- Defined in:
- lib/active_fedora/associations/builder/directly_contains.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from CollectionAssociation
Attributes inherited from Association
#inversed, #owner, #reflection, #target
Class Method Summary collapse
Methods inherited from CollectionAssociation
#add_to_target, #any?, #build, #concat, #concat_records, #count, #create, #create!, #delete, #delete_all, #destroy, #destroy_all, #empty?, #find, #first, #ids_reader, #ids_writer, #include?, #last, #load_from_solr, #load_target, #null_scope?, #reader, #replace, #reset, #scope, #select, #size, #target=, #to_ary, #writer
Methods inherited from Association
#association_scope, #initialize, #initialize_attributes, #load_target, #loaded!, #loaded?, #reload, #reset, #reset_scope, #scope, #set_inverse_instance, #stale_target?, #target_scope
Constructor Details
This class inherits a constructor from ActiveFedora::Associations::Association
Class Method Details
.macro ⇒ Object
3 4 5 |
# File 'lib/active_fedora/associations/builder/directly_contains.rb', line 3 def self.macro :directly_contains end |
.valid_options(options) ⇒ Object
7 8 9 |
# File 'lib/active_fedora/associations/builder/directly_contains.rb', line 7 def self.() super + [:has_member_relation, :is_member_of_relation] - [:predicate] end |
.validate_options(options) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/active_fedora/associations/builder/directly_contains.rb', line 11 def self.() super raise ArgumentError, "You must specify a :has_member_relation or :is_member_of_relation predicate for #{name}" if ![:has_member_relation] && ![:is_member_of_relation] raise ArgumentError, "Predicate must be a kind of RDF::URI" if ![:has_member_relation].is_a?(RDF::URI) && ![:is_member_of_relation].is_a?(RDF::URI) end |