Class: Smsinabox::Reply
- Inherits:
-
Object
- Object
- Smsinabox::Reply
- Defined in:
- lib/smsinabox/reply.rb
Instance Attribute Summary collapse
-
#event_id ⇒ Object
Returns the value of attribute event_id.
-
#from ⇒ Object
Returns the value of attribute from.
-
#id ⇒ Object
Returns the value of attribute id.
-
#message ⇒ Object
Returns the value of attribute message.
-
#original ⇒ Object
Returns the value of attribute original.
-
#received ⇒ Object
Returns the value of attribute received.
-
#sent ⇒ Object
Returns the value of attribute sent.
-
#sent_customer_id ⇒ Object
Returns the value of attribute sent_customer_id.
-
#sent_id ⇒ Object
Returns the value of attribute sent_id.
Class Method Summary collapse
-
.from_response(nokogiri_xml) ⇒ Object
Generate a reply from the nokogiri response fragment.
Instance Attribute Details
#event_id ⇒ Object
Returns the value of attribute event_id.
24 25 26 |
# File 'lib/smsinabox/reply.rb', line 24 def event_id @event_id end |
#from ⇒ Object
Returns the value of attribute from.
24 25 26 |
# File 'lib/smsinabox/reply.rb', line 24 def from @from end |
#id ⇒ Object
Returns the value of attribute id.
24 25 26 |
# File 'lib/smsinabox/reply.rb', line 24 def id @id end |
#message ⇒ Object
Returns the value of attribute message.
24 25 26 |
# File 'lib/smsinabox/reply.rb', line 24 def @message end |
#original ⇒ Object
Returns the value of attribute original.
24 25 26 |
# File 'lib/smsinabox/reply.rb', line 24 def original @original end |
#received ⇒ Object
Returns the value of attribute received.
24 25 26 |
# File 'lib/smsinabox/reply.rb', line 24 def received @received end |
#sent ⇒ Object
Returns the value of attribute sent.
24 25 26 |
# File 'lib/smsinabox/reply.rb', line 24 def sent @sent end |
#sent_customer_id ⇒ Object
Returns the value of attribute sent_customer_id.
24 25 26 |
# File 'lib/smsinabox/reply.rb', line 24 def sent_customer_id @sent_customer_id end |
#sent_id ⇒ Object
Returns the value of attribute sent_id.
24 25 26 |
# File 'lib/smsinabox/reply.rb', line 24 def sent_id @sent_id end |
Class Method Details
.from_response(nokogiri_xml) ⇒ Object
Generate a reply from the nokogiri response fragment
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/smsinabox/reply.rb', line 7 def from_response( nokogiri_xml ) reply = new reply.id = nokogiri_xml.xpath('./replyid/text()').to_s.to_i reply.event_id = nokogiri_xml.xpath('./eventid/text()').to_s.to_i reply.from = nokogiri_xml.xpath('./numfrom/text()').to_s reply. = nokogiri_xml.xpath('./receiveddata/text()').to_s reply.sent_id = nokogiri_xml.xpath('./sentid/text()').to_s.to_i reply.original = nokogiri_xml.xpath('./sentdata/text()').to_s reply.sent_customer_id = nokogiri_xml.xpath('./sentcustomerid/text()').to_s reply.received = nokogiri_xml.xpath('./received/text()').to_s reply.sent = nokogiri_xml.xpath('./sentdatetime/text()').to_s reply end |