Class: Tapsilat::OrderStatusResponse
- Inherits:
-
Object
- Object
- Tapsilat::OrderStatusResponse
- Defined in:
- lib/tapsilat/orders.rb
Overview
Response class for order status endpoint
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(response_data) ⇒ OrderStatusResponse
constructor
A new instance of OrderStatusResponse.
- #status ⇒ Object
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(response_data) ⇒ OrderStatusResponse
Returns a new instance of OrderStatusResponse.
719 720 721 722 723 724 725 726 727 728 |
# File 'lib/tapsilat/orders.rb', line 719 def initialize(response_data) @data = case response_data when Hash response_data when String JSON.parse(response_data) else {} end end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
717 718 719 |
# File 'lib/tapsilat/orders.rb', line 717 def data @data end |
Instance Method Details
#status ⇒ Object
730 731 732 |
# File 'lib/tapsilat/orders.rb', line 730 def status @data['status'] end |
#to_h ⇒ Object
734 735 736 |
# File 'lib/tapsilat/orders.rb', line 734 def to_h @data end |
#to_json(*args) ⇒ Object
738 739 740 |
# File 'lib/tapsilat/orders.rb', line 738 def to_json(*args) @data.to_json(*args) end |