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.
76 77 78 |
# File 'lib/active_fedora/rdf/properties.rb', line 76 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
79 80 81 82 83 84 85 |
# File 'lib/active_fedora/rdf/properties.rb', line 79 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.
75 76 77 |
# File 'lib/active_fedora/rdf/properties.rb', line 75 def parent @parent end |