Class: Elibri::ONIX::Release_3_0::Header
- Inherits:
-
Object
- Object
- Elibri::ONIX::Release_3_0::Header
- Includes:
- Inspector
- Defined in:
- lib/elibri_onix/onix_3_0/header.rb
Overview
Class representing ONIX header
Constant Summary collapse
- ATTRIBUTES =
:nodoc:
[ :sent_date_time, :sender ]
- RELATIONS =
:nodoc:
[]
Instance Attribute Summary collapse
-
#sender ⇒ Object
sender of the message - Elibri::ONIX::Release_3_0::Sender.
-
#sent_date_time ⇒ Object
date, at which message was sent.
-
#to_xml ⇒ Object
xml representation of message header.
Instance Method Summary collapse
-
#initialize(data) ⇒ Header
constructor
A new instance of Header.
-
#inspect_include_fields ⇒ Object
:nodoc:.
Methods included from Inspector
#attribute_for_inspect, #inspect
Constructor Details
#initialize(data) ⇒ Header
Returns a new instance of Header.
33 34 35 36 37 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 33 def initialize(data) @to_xml = data.to_s @sent_date_time = Date.parse(data.xpath('xmlns:SentDateTime').try(:text)) if data.xpath('xmlns:SentDateTime') @sender = Sender.new(data.at_xpath('xmlns:Sender')) if data.at_xpath('xmlns:Sender') end |
Instance Attribute Details
#sender ⇒ Object
sender of the message - Elibri::ONIX::Release_3_0::Sender
15 16 17 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 15 def sender @sender end |
#sent_date_time ⇒ Object
date, at which message was sent
12 13 14 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 12 def sent_date_time @sent_date_time end |
#to_xml ⇒ Object
xml representation of message header
18 19 20 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 18 def to_xml @to_xml end |
Instance Method Details
#inspect_include_fields ⇒ Object
:nodoc:
29 30 31 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 29 def inspect_include_fields [:sender] end |