Class: Registrar::Order

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#dateObject

The date the order was created



12
13
14
# File 'lib/registrar/order.rb', line 12

def date
  @date
end

#identifierObject (readonly)

The service-specific identifier for the order.



6
7
8
# File 'lib/registrar/order.rb', line 6

def identifier
  @identifier
end

#statusObject

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.

Returns:

  • (Boolean)


27
28
29
# File 'lib/registrar/order.rb', line 27

def complete?
  ![:open, :unknown].include?(@status) 
end

#domainsObject

Get the domains associated with this order



22
23
24
# File 'lib/registrar/order.rb', line 22

def domains
  @domains ||= []
end

#open?Boolean

Returns:

  • (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

Returns:

  • (Boolean)


35
36
37
# File 'lib/registrar/order.rb', line 35

def successful?
  @successful
end