Class: Moip2::Resource::Order
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Moip2::Resource::Order
- Defined in:
- lib/moip2/resource/order.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#external_id ⇒ Object
readonly
Returns the value of attribute external_id.
-
#payment_api ⇒ Object
readonly
Returns the value of attribute payment_api.
Instance Method Summary collapse
- #create_payment(payment) ⇒ Object
-
#initialize(client, response) ⇒ Order
constructor
A new instance of Order.
Constructor Details
#initialize(client, response) ⇒ Order
Returns a new instance of Order.
8 9 10 11 12 13 14 15 16 |
# File 'lib/moip2/resource/order.rb', line 8 def initialize(client, response) super(response) @client = client if response.respond_to?(:external_id) @payment_api = PaymentApi.new(client) @external_id = response.external_id end end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/moip2/resource/order.rb', line 6 def client @client end |
#external_id ⇒ Object (readonly)
Returns the value of attribute external_id.
6 7 8 |
# File 'lib/moip2/resource/order.rb', line 6 def external_id @external_id end |
#payment_api ⇒ Object (readonly)
Returns the value of attribute payment_api.
6 7 8 |
# File 'lib/moip2/resource/order.rb', line 6 def payment_api @payment_api end |
Instance Method Details
#create_payment(payment) ⇒ Object
18 19 20 |
# File 'lib/moip2/resource/order.rb', line 18 def create_payment(payment) payment_api.create(external_id, payment) end |