Class: Registrar::Provider::Enom::Order

Inherits:
Object
  • Object
show all
Defined in:
lib/registrar/provider/enom/order.rb

Overview

An Enom order.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Order

Returns a new instance of Order.



11
12
13
# File 'lib/registrar/provider/enom/order.rb', line 11

def initialize(id)
  @id = id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#order_dateObject

Returns the value of attribute order_date.



8
9
10
# File 'lib/registrar/provider/enom/order.rb', line 8

def order_date
  @order_date
end

#order_statusObject

Returns the value of attribute order_status.



7
8
9
# File 'lib/registrar/provider/enom/order.rb', line 7

def order_status
  @order_status
end

#statusObject

Returns the value of attribute status.



9
10
11
# File 'lib/registrar/provider/enom/order.rb', line 9

def status
  @status
end

Instance Method Details

#to_orderObject

Get a generic Registrar::Order object to use.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/registrar/provider/enom/order.rb', line 24

def to_order
  order = Registrar::Order.new(id)
  order.successful = status.downcase == "successful"
  
  order.status = case order_status.downcase
  when 'open' then :open 
  when 'closed' then :closed
  else
    order_status.downcase.to_sym
  end

  order.date = order_date 
  order
end