Class: DIDWW::Resource::Order

Inherits:
Base
  • Object
show all
Includes:
Callback::CONST
Defined in:
lib/didww/resource/order.rb

Constant Summary collapse

STATUS_PENDING =

Possible values for order.status

'Pending'
STATUS_COMPLETED =
'Completed'
STATUS_CANCELLED =
'Canceled'
STATUSES =
[
  STATUS_PENDING,
  STATUS_COMPLETED,
  STATUS_CANCELLED
].freeze

Constants included from Callback::CONST

Callback::CONST::CALLBACK_METHODS, Callback::CONST::CALLBACK_METHOD_GET, Callback::CONST::CALLBACK_METHOD_POST

Instance Method Summary collapse

Methods inherited from Base

#as_json_api

Constructor Details

#initialize(*args) ⇒ Order

Type: String Description: GET or POST



57
58
59
60
# File 'lib/didww/resource/order.rb', line 57

def initialize(*args)
  super
  self.items ||= []
end

Instance Method Details

#cancelled?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/didww/resource/order.rb', line 70

def cancelled?
  STATUS_CANCELLED == status
end

#completed?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/didww/resource/order.rb', line 66

def completed?
  STATUS_COMPLETED == status
end

#pending?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/didww/resource/order.rb', line 62

def pending?
  STATUS_PENDING == status
end