Class: Registrar::Provider::OpenSRS::Order
- Inherits:
-
Object
- Object
- Registrar::Provider::OpenSRS::Order
- Defined in:
- lib/registrar/provider/opensrs/order.rb
Instance Method Summary collapse
- #add_domain(domain_name, registrant) ⇒ Object
- #complete? ⇒ Boolean
- #domains ⇒ Object
- #id ⇒ Object
-
#initialize(xml) ⇒ Order
constructor
A new instance of Order.
- #successful? ⇒ Boolean
- #to_order ⇒ Object
Constructor Details
#initialize(xml) ⇒ Order
Returns a new instance of Order.
6 7 8 9 |
# File 'lib/registrar/provider/opensrs/order.rb', line 6 def initialize(xml) @xml = Nokogiri::XML(xml) @domains = [] end |
Instance Method Details
#add_domain(domain_name, registrant) ⇒ Object
28 29 30 31 |
# File 'lib/registrar/provider/opensrs/order.rb', line 28 def add_domain(domain_name, registrant) @domains << create_domain(domain_name, registrant) self end |
#complete? ⇒ Boolean
19 20 21 22 |
# File 'lib/registrar/provider/opensrs/order.rb', line 19 def complete? status = field_hash_element("status").inner_text status != 'pending' || status != 'waiting_ca_owner_approval' end |
#domains ⇒ Object
24 25 26 |
# File 'lib/registrar/provider/opensrs/order.rb', line 24 def domains @domains end |
#id ⇒ Object
11 12 13 |
# File 'lib/registrar/provider/opensrs/order.rb', line 11 def id field_hash_element('id').inner_text end |
#successful? ⇒ Boolean
15 16 17 |
# File 'lib/registrar/provider/opensrs/order.rb', line 15 def successful? element("is_success").inner_text == '1' end |