Class: Elibri::ONIX::Release_3_0::Collection
- Inherits:
-
Object
- Object
- Elibri::ONIX::Release_3_0::Collection
- Includes:
- HashId
- Defined in:
- lib/elibri_onix/onix_3_0/collection.rb
Constant Summary collapse
- ATTRIBUTES =
from ONIX documentation: A bibliographic collection in ONIX 3.0 means a fixed or indefinite number of products, published over a fixed or indefinite time period, which share collective attributes (including a collective title) that are required as part of the bibliographic record of each individual product. In this respect, such a collection is most often thought of as a series. A bibliographic collection may, however, also be traded as a single product (often thought of as a set), but this does not alter the way in which its collective attributes are described in the ONIX records for the individual products. set. If a fixed or indefinite number of products have a collective title and possibly other collective attributes that are required as part of the bibliographic record of each individual product, then those products are regarded as forming a collection. ONIX 3.0 recognises two major types of collection: a publisher collection, and an ascribed collection. A publisher collection is one that is identified either on the products themselves or in product information originating from the publisher. An ascribed collection is one that is identified by another party in the information supply chain, usually an aggregator, for the benefit of retailers and consumers.
[ :type, :title_detail, :full_title, :type_name ]
- RELATIONS =
[ :elements, :inspect_include_fields ]
Constants included from HashId
HashId::SKIPPED_2, HashId::SKIPPED_ATTRIBS
Instance Attribute Summary collapse
-
#elements ⇒ Object
Returns the value of attribute elements.
-
#title_detail ⇒ Object
Returns the value of attribute title_detail.
-
#to_xml ⇒ Object
Returns the value of attribute to_xml.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #full_title ⇒ Object
-
#initialize(data) ⇒ Collection
constructor
A new instance of Collection.
- #inspect_include_fields ⇒ Object
- #type_name ⇒ Object
Methods included from HashId
Constructor Details
#initialize(data) ⇒ Collection
Returns a new instance of Collection.
35 36 37 38 39 40 |
# File 'lib/elibri_onix/onix_3_0/collection.rb', line 35 def initialize(data) @to_xml = data.to_s @type = data.at_xpath('xmlns:CollectionType').try(:text) @elements = data.xpath('xmlns:TitleElement').map { |element_data| TitleElement.new(element_data) } @title_detail = TitleDetail.new(data.at_xpath('xmlns:TitleDetail')) if data.at_xpath('xmlns:TitleDetail') end |
Instance Attribute Details
#elements ⇒ Object
Returns the value of attribute elements.
33 34 35 |
# File 'lib/elibri_onix/onix_3_0/collection.rb', line 33 def elements @elements end |
#title_detail ⇒ Object
Returns the value of attribute title_detail.
33 34 35 |
# File 'lib/elibri_onix/onix_3_0/collection.rb', line 33 def title_detail @title_detail end |
#to_xml ⇒ Object
Returns the value of attribute to_xml.
33 34 35 |
# File 'lib/elibri_onix/onix_3_0/collection.rb', line 33 def to_xml @to_xml end |
#type ⇒ Object
Returns the value of attribute type.
33 34 35 |
# File 'lib/elibri_onix/onix_3_0/collection.rb', line 33 def type @type end |
Instance Method Details
#full_title ⇒ Object
42 43 44 |
# File 'lib/elibri_onix/onix_3_0/collection.rb', line 42 def full_title title_detail.try(:full_title) end |
#inspect_include_fields ⇒ Object
50 51 52 |
# File 'lib/elibri_onix/onix_3_0/collection.rb', line 50 def inspect_include_fields [:type_name] end |