Class: Elibri::ONIX::Release_3_0::SupplierIdentifier

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

Constant Summary collapse

ATTRIBUTES =
[
  :type, :type_name, :value
]
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) ⇒ SupplierIdentifier

Returns a new instance of SupplierIdentifier.



27
28
29
30
31
32
# File 'lib/elibri_onix/onix_3_0/supplier_identifier.rb', line 27

def initialize(data)
  @to_xml = data.to_s
  @type = data.at_xpath('xmlns:SupplierIDType').try(:text)
  @type_name = data.at_xpath('xmlns:IDTypeName').try(:text)
  @value = data.at_xpath('xmlns:IDValue').try(:text)
end

Instance Attribute Details

#to_xmlObject

Returns the value of attribute to_xml.



25
26
27
# File 'lib/elibri_onix/onix_3_0/supplier_identifier.rb', line 25

def to_xml
  @to_xml
end

#typeObject

Returns the value of attribute type.



25
26
27
# File 'lib/elibri_onix/onix_3_0/supplier_identifier.rb', line 25

def type
  @type
end

#type_nameObject

Returns the value of attribute type_name.



25
26
27
# File 'lib/elibri_onix/onix_3_0/supplier_identifier.rb', line 25

def type_name
  @type_name
end

#valueObject

Returns the value of attribute value.



25
26
27
# File 'lib/elibri_onix/onix_3_0/supplier_identifier.rb', line 25

def value
  @value
end