Class: Loopiator::Models::Domain
- Inherits:
-
Object
- Object
- Loopiator::Models::Domain
- Defined in:
- lib/loopiator/models/domain.rb
Overview
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#expiration_date ⇒ Object
Returns the value of attribute expiration_date.
-
#paid ⇒ Object
Returns the value of attribute paid.
-
#reference_number ⇒ Object
Returns the value of attribute reference_number.
-
#registered ⇒ Object
Returns the value of attribute registered.
-
#renewal_status ⇒ Object
Returns the value of attribute renewal_status.
-
#unpaid_amount ⇒ Object
Returns the value of attribute unpaid_amount.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Domain
constructor
A new instance of Domain.
- #needs_to_be_paid? ⇒ Boolean
- #paid? ⇒ Boolean
- #registered? ⇒ Boolean
Constructor Details
#initialize(hash) ⇒ Domain
Returns a new instance of Domain.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/loopiator/models/domain.rb', line 8 def initialize(hash) hash.symbolize_keys! self.domain = hash.fetch(:domain, "") self.paid = hash.fetch(:paid, 0).eql?(1) self.registered = hash.fetch(:registered, 0).eql?(1) self.renewal_status = hash.fetch(:renewal_status, "") self.expiration_date = hash.fetch(:expiration_date, "") self.reference_number = hash.fetch(:reference_no, "").to_s self.unpaid_amount = hash.fetch(:unpaid_amount, 0) end |
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
6 7 8 |
# File 'lib/loopiator/models/domain.rb', line 6 def domain @domain end |
#expiration_date ⇒ Object
Returns the value of attribute expiration_date.
6 7 8 |
# File 'lib/loopiator/models/domain.rb', line 6 def expiration_date @expiration_date end |
#paid ⇒ Object
Returns the value of attribute paid.
6 7 8 |
# File 'lib/loopiator/models/domain.rb', line 6 def paid @paid end |
#reference_number ⇒ Object
Returns the value of attribute reference_number.
6 7 8 |
# File 'lib/loopiator/models/domain.rb', line 6 def reference_number @reference_number end |
#registered ⇒ Object
Returns the value of attribute registered.
6 7 8 |
# File 'lib/loopiator/models/domain.rb', line 6 def registered @registered end |
#renewal_status ⇒ Object
Returns the value of attribute renewal_status.
6 7 8 |
# File 'lib/loopiator/models/domain.rb', line 6 def renewal_status @renewal_status end |
#unpaid_amount ⇒ Object
Returns the value of attribute unpaid_amount.
6 7 8 |
# File 'lib/loopiator/models/domain.rb', line 6 def unpaid_amount @unpaid_amount end |
Instance Method Details
#needs_to_be_paid? ⇒ Boolean
28 29 30 |
# File 'lib/loopiator/models/domain.rb', line 28 def needs_to_be_paid? (!paid? && unpaid_amount > 0) end |
#paid? ⇒ Boolean
20 21 22 |
# File 'lib/loopiator/models/domain.rb', line 20 def paid? paid end |
#registered? ⇒ Boolean
24 25 26 |
# File 'lib/loopiator/models/domain.rb', line 24 def registered? registered end |