Class: Elibri::ONIX::Release_3_0::Imprint

Inherits:
Object
  • Object
show all
Includes:
HashId
Defined in:
lib/elibri_onix/onix_3_0/imprint.rb

Constant Summary collapse

ATTRIBUTES =

from ONIX documentation: A repeatable group of data elements which together identify an imprint or brand under which the product is marketed. The composite must carry either a name identifier or a name or both.

[
  :name
]
RELATIONS =
[]

Constants included from HashId

HashId::SKIPPED_2, HashId::SKIPPED_ATTRIBS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashId

#calculate_hash, #eid

Constructor Details

#initialize(data) ⇒ Imprint

Returns a new instance of Imprint.



23
24
25
26
# File 'lib/elibri_onix/onix_3_0/imprint.rb', line 23

def initialize(data)
  @to_xml = data.to_s
  @name = data.at_xpath('xmlns:ImprintName').try(:text)
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/elibri_onix/onix_3_0/imprint.rb', line 21

def name
  @name
end

#to_xmlObject

Returns the value of attribute to_xml.



21
22
23
# File 'lib/elibri_onix/onix_3_0/imprint.rb', line 21

def to_xml
  @to_xml
end