Class: ONIX::RelatedMaterial

Inherits:
SubsetDSL show all
Defined in:
lib/onix/related_material.rb

Instance Method Summary collapse

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_productsObject

: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_productsObject

: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

: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