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
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.
23 24 25 26 27 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 23 def initialize(data) @to_xml = data.to_s @sent_date_time = Date.parse(data.at_css('SentDateTime').text) if data.at_css('SentDateTime') @sender = Sender.new(data.at_css('Sender')) if data.at_css('Sender') end |
Instance Attribute Details
#sender ⇒ Object
sender of the message - Elibri::ONIX::Release_3_0::Sender
13 14 15 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 13 def sender @sender end |
#sent_date_time ⇒ Object
date, at which message was sent
10 11 12 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 10 def sent_date_time @sent_date_time end |
#to_xml ⇒ Object
xml representation of message header
16 17 18 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 16 def to_xml @to_xml end |
Instance Method Details
#inspect_include_fields ⇒ Object
:nodoc:
19 20 21 |
# File 'lib/elibri_onix/onix_3_0/header.rb', line 19 def inspect_include_fields [:sender] end |