Class: PaysonAPI::Envelope
- Inherits:
-
Object
- Object
- PaysonAPI::Envelope
- Defined in:
- lib/payson_api/envelope.rb
Constant Summary collapse
- FORMAT_STRING =
"responseEnvelope.%s"
Instance Attribute Summary collapse
-
#ack ⇒ Object
Returns the value of attribute ack.
-
#correlation_id ⇒ Object
Returns the value of attribute correlation_id.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ack, timestamp, correlation_id) ⇒ Envelope
constructor
A new instance of Envelope.
Constructor Details
#initialize(ack, timestamp, correlation_id) ⇒ Envelope
Returns a new instance of Envelope.
8 9 10 11 12 |
# File 'lib/payson_api/envelope.rb', line 8 def initialize(ack, , correlation_id) @ack = ack @timestamp = @correlation_id = correlation_id end |
Instance Attribute Details
#ack ⇒ Object
Returns the value of attribute ack.
5 6 7 |
# File 'lib/payson_api/envelope.rb', line 5 def ack @ack end |
#correlation_id ⇒ Object
Returns the value of attribute correlation_id.
5 6 7 |
# File 'lib/payson_api/envelope.rb', line 5 def correlation_id @correlation_id end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
5 6 7 |
# File 'lib/payson_api/envelope.rb', line 5 def @timestamp end |
Class Method Details
.parse(data) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/payson_api/envelope.rb', line 14 def self.parse(data) ack = data[FORMAT_STRING % 'ack'] = DateTime.parse(CGI.unescape(data[FORMAT_STRING % 'timestamp'].to_s)) correlation_id = data[FORMAT_STRING % 'correlationId'] self.new(ack, , correlation_id) end |