Class: Registrar::Order
- Inherits:
-
Object
- Object
- Registrar::Order
- Defined in:
- lib/registrar/order.rb
Overview
Instances of this class contain details about the current state of a particular order with the registrar.
Instance Attribute Summary collapse
-
#date ⇒ Object
The date the order was created.
-
#identifier ⇒ Object
readonly
The service-specific identifier for the order.
-
#status ⇒ Object
The current status of the order.
Instance Method Summary collapse
-
#complete? ⇒ Boolean
Return true if the order is complete.
-
#domains ⇒ Object
Get the domains associated with this order.
-
#initialize(identifier) ⇒ Order
constructor
Construct a new Order instance.
- #open? ⇒ Boolean
- #successful=(successful) ⇒ Object
- #successful? ⇒ Boolean
Constructor Details
#initialize(identifier) ⇒ Order
Construct a new Order instance.
15 16 17 18 19 |
# File 'lib/registrar/order.rb', line 15 def initialize(identifier) @identifier = identifier @status = :unknown @successful = false end |
Instance Attribute Details
#date ⇒ Object
The date the order was created
12 13 14 |
# File 'lib/registrar/order.rb', line 12 def date @date end |
#identifier ⇒ Object (readonly)
The service-specific identifier for the order.
6 7 8 |
# File 'lib/registrar/order.rb', line 6 def identifier @identifier end |
#status ⇒ Object
The current status of the order
9 10 11 |
# File 'lib/registrar/order.rb', line 9 def status @status end |
Instance Method Details
#complete? ⇒ Boolean
Return true if the order is complete.
27 28 29 |
# File 'lib/registrar/order.rb', line 27 def complete? ![:open, :unknown].include?(@status) end |
#domains ⇒ Object
Get the domains associated with this order
22 23 24 |
# File 'lib/registrar/order.rb', line 22 def domains @domains ||= [] end |
#open? ⇒ Boolean
31 32 33 |
# File 'lib/registrar/order.rb', line 31 def open? @status == :open end |
#successful=(successful) ⇒ Object
39 40 41 |
# File 'lib/registrar/order.rb', line 39 def successful=(successful) @successful = successful end |
#successful? ⇒ Boolean
35 36 37 |
# File 'lib/registrar/order.rb', line 35 def successful? @successful end |