Class: PaysonAPI::V1::Envelope
- Inherits:
-
Object
- Object
- PaysonAPI::V1::Envelope
- Defined in:
- lib/payson_api/v1/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.
13 14 15 16 17 |
# File 'lib/payson_api/v1/envelope.rb', line 13 def initialize(ack, , correlation_id) @ack = ack = @correlation_id = correlation_id end |
Instance Attribute Details
#ack ⇒ Object
Returns the value of attribute ack.
9 10 11 |
# File 'lib/payson_api/v1/envelope.rb', line 9 def ack @ack end |
#correlation_id ⇒ Object
Returns the value of attribute correlation_id.
9 10 11 |
# File 'lib/payson_api/v1/envelope.rb', line 9 def correlation_id @correlation_id end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
9 10 11 |
# File 'lib/payson_api/v1/envelope.rb', line 9 def end |
Class Method Details
.parse(data) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/payson_api/v1/envelope.rb', line 19 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'] new(ack, , correlation_id) end |