Class: Tapsilat::OrderStatusResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/tapsilat/orders.rb

Overview

Response class for order status endpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (readonly)

Returns the value of attribute data.



717
718
719
# File 'lib/tapsilat/orders.rb', line 717

def data
  @data
end

Instance Method Details

#statusObject



730
731
732
# File 'lib/tapsilat/orders.rb', line 730

def status
  @data['status']
end

#to_hObject



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