Class: Cardia::Order
Overview
This is the very minimum that’s required in order for an Order to function. You probably have your own… For home baked order classes, you need to implement methods listed below
Defined Under Namespace
Classes: Status
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#reference ⇒ Object
readonly
You need to provide a reference that’s guaranteed to be unique for your merchant.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#be_confirmed ⇒ Object
Callback that’s called when an order is confirmed.
-
#compute_access_key ⇒ Object
:nodoc:.
-
#initialize(amount, description) ⇒ Order
constructor
Creates an instance: Parameters: *
amount
: The amount as an integer *description
: Give a describing name (not used for much…).
Constructor Details
#initialize(amount, description) ⇒ Order
Creates an instance: Parameters:
-
amount
: The amount as an integer -
description
: Give a describing name (not used for much…)
11 12 13 14 |
# File 'lib/cardia/order.rb', line 11 def initialize(amount, description) @amount,@description = amount, description @reference = rand(10000) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
5 6 7 |
# File 'lib/cardia/order.rb', line 5 def amount @amount end |
#customer ⇒ Object
Returns the value of attribute customer.
6 7 8 |
# File 'lib/cardia/order.rb', line 6 def customer @customer end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/cardia/order.rb', line 5 def description @description end |
#reference ⇒ Object (readonly)
You need to provide a reference that’s guaranteed to be unique for your merchant
17 18 19 |
# File 'lib/cardia/order.rb', line 17 def reference @reference end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/cardia/order.rb', line 6 def status @status end |
Instance Method Details
#be_confirmed ⇒ Object
Callback that’s called when an order is confirmed
26 27 28 |
# File 'lib/cardia/order.rb', line 26 def be_confirmed @status = Status.confirmed end |
#compute_access_key ⇒ Object
:nodoc:
21 22 23 |
# File 'lib/cardia/order.rb', line 21 def compute_access_key #:nodoc: "ello" end |