Class: ONIX::RelatedMaterial
- Defined in:
- lib/onix/related_material.rb
Instance Method Summary collapse
-
#alternative_format_products ⇒ Object
:category: High level alternative format products RelatedProduct array.
- #linking(human) ⇒ Object
-
#part_of_products ⇒ Object
:category: High level is part of products RelatedProduct array.
-
#print_products ⇒ Object
:category: High level print products RelatedProduct array.
Methods inherited from SubsetDSL
_ancestor_registered_scopes, _ancestors_registered_elements, ancestor_registered_scopes, ancestors_registered_elements, element, elements, get_class, #initialize, #parse, ref_to_short, registered_elements, registered_scopes, scope, short_to_ref, #unsupported
Methods inherited from Subset
parse, #parse, tag_match, #tag_match, #unsupported
Constructor Details
This class inherits a constructor from ONIX::SubsetDSL
Instance Method Details
#alternative_format_products ⇒ Object
:category: High level alternative format products RelatedProduct array
26 27 28 |
# File 'lib/onix/related_material.rb', line 26 def alternative_format_products linking("AlternativeFormat") end |
#linking(human) ⇒ Object
8 9 10 |
# File 'lib/onix/related_material.rb', line 8 def linking(human) @related_products.select{|rp| rp.code.human==human} end |
#part_of_products ⇒ Object
:category: High level is part of products RelatedProduct array
20 21 22 |
# File 'lib/onix/related_material.rb', line 20 def part_of_products linking("IsPartOf") end |
#print_products ⇒ Object
:category: High level print products RelatedProduct array
14 15 16 |
# File 'lib/onix/related_material.rb', line 14 def print_products linking("EpublicationBasedOnPrintProduct") + self.alternative_format_products.select{|rp| rp.form && rp.form.code=~/^B/} end |