Class: Esendex::MessageFailedEvent
- Inherits:
-
Object
- Object
- Esendex::MessageFailedEvent
- Includes:
- HashSerialisation
- Defined in:
- lib/esendex/message_failed_event.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#message_id ⇒ Object
Returns the value of attribute message_id.
-
#occurred_at ⇒ Object
Returns the value of attribute occurred_at.
Class Method Summary collapse
Methods included from HashSerialisation
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
16 17 18 |
# File 'lib/esendex/message_failed_event.rb', line 16 def account_id @account_id end |
#id ⇒ Object
Returns the value of attribute id.
16 17 18 |
# File 'lib/esendex/message_failed_event.rb', line 16 def id @id end |
#message_id ⇒ Object
Returns the value of attribute message_id.
16 17 18 |
# File 'lib/esendex/message_failed_event.rb', line 16 def end |
#occurred_at ⇒ Object
Returns the value of attribute occurred_at.
16 17 18 |
# File 'lib/esendex/message_failed_event.rb', line 16 def occurred_at @occurred_at end |
Class Method Details
.from_xml(source) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/esendex/message_failed_event.rb', line 18 def self.from_xml(source) doc = Nokogiri::XML source event = MessageFailedEvent.new event.id = doc.at_xpath("/MessageFailed/Id").content event. = doc.at_xpath("/MessageFailed/MessageId").content event.account_id = doc.at_xpath("/MessageFailed/AccountId").content occurred_at_s = doc.at_xpath("/MessageFailed/OccurredAt").content event.occurred_at = DateTime.strptime(occurred_at_s, "%Y-%m-%dT%H:%M:%S").to_time event end |