Class: ActiveFedora::Rdf::Properties::Mapper
- Inherits:
-
Object
- Object
- ActiveFedora::Rdf::Properties::Mapper
- Defined in:
- lib/active_fedora/rdf/properties.rb
Overview
Mapper is for backwards compatibility with AF::RDFDatastream
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(parent) ⇒ Mapper
constructor
A new instance of Mapper.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(parent) ⇒ Mapper
Returns a new instance of Mapper.
90 91 92 |
# File 'lib/active_fedora/rdf/properties.rb', line 90 def initialize(parent) @parent = parent end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
93 94 95 96 97 98 99 |
# File 'lib/active_fedora/rdf/properties.rb', line 93 def method_missing(name, *args, &block) properties = args.first || {} vocab = properties.delete(:in) to = properties.delete(:to) || name predicate = vocab.send(to) parent.property(name, properties.merge(predicate: predicate), &block) end |
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
89 90 91 |
# File 'lib/active_fedora/rdf/properties.rb', line 89 def parent @parent end |