module ActiveFedora::FedoraAttributes::ClassMethods
Public Instance Methods
resource_class()
click to toggle source
We make a unique class, because properties belong to a class. This keeps properties from different objects separate. Since the copy of properties can only happen once, we don’t want to invoke it until all properties have been defined.
# File lib/active_fedora/fedora_attributes.rb, line 58 def resource_class @generated_resource_class ||= begin klass = const_set(:GeneratedResourceSchema, Class.new(resource_class_factory)) klass.configure active_triple_options klass.properties.merge(properties).each do |_property, config| klass.property(config.term, predicate: config.predicate, class_name: config.class_name) end klass end end
resource_class_factory()
click to toggle source
Allow inherited classes to override what class is used for triples ORM.
# File lib/active_fedora/fedora_attributes.rb, line 72 def resource_class_factory ActiveTriples::Resource end
Private Instance Methods
active_triple_options()
click to toggle source
@return a Hash of options suitable for passing to ActiveTriples::Base.configure
# File lib/active_fedora/fedora_attributes.rb, line 79 def active_triple_options { type: type, rdf_label: rdf_label } end