Class: ActiveFedora::Associations::IDComposite
- Inherits:
-
Object
- Object
- ActiveFedora::Associations::IDComposite
- Includes:
- Enumerable
- Defined in:
- lib/active_fedora/associations/id_composite.rb
Overview
A composite object for an array of IDs. This abstracts away the fact that an ID might be either a relative ID or a URI to a resource.
Instance Attribute Summary collapse
-
#id_translator ⇒ Object
readonly
Returns the value of attribute id_translator.
-
#ids ⇒ Object
readonly
Returns the value of attribute ids.
Instance Method Summary collapse
- #each ⇒ Array<relative_id>
-
#initialize(ids, id_translator) ⇒ IDComposite
constructor
A new instance of IDComposite.
Constructor Details
#initialize(ids, id_translator) ⇒ IDComposite
Returns a new instance of IDComposite.
11 12 13 14 |
# File 'lib/active_fedora/associations/id_composite.rb', line 11 def initialize(ids, id_translator) @ids = ids @id_translator = id_translator end |
Instance Attribute Details
#id_translator ⇒ Object (readonly)
Returns the value of attribute id_translator.
6 7 8 |
# File 'lib/active_fedora/associations/id_composite.rb', line 6 def id_translator @id_translator end |
#ids ⇒ Object (readonly)
Returns the value of attribute ids.
6 7 8 |
# File 'lib/active_fedora/associations/id_composite.rb', line 6 def ids @ids end |
Instance Method Details
#each ⇒ Array<relative_id>
17 18 19 20 21 |
# File 'lib/active_fedora/associations/id_composite.rb', line 17 def each ids.each do |id| yield convert(id) end end |