Class: Dnsimple::Struct::Domain
- Defined in:
- lib/dnsimple/struct/domain.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Integer
The associated account ID.
-
#auto_renew ⇒ Bool
True if the domain is set to auto-renew, false otherwise.
-
#created_at ⇒ String
When the domain was created in DNSimple.
-
#expires_at ⇒ String
The timestamp when domain will expire.
-
#id ⇒ Integer
The domain ID in DNSimple.
-
#name ⇒ String
The domain name.
-
#private_whois ⇒ Bool
True if the domain WHOIS privacy is enabled, false otherwise.
-
#registrant_id ⇒ Integer
The associated registrant (contact) ID.
-
#state ⇒ String
The domain state.
-
#token ⇒ String
The domain API token used for domain authentication.
-
#updated_at ⇒ String
When the domain was last updated in DNSimple.
Instance Method Summary collapse
-
#expires_on ⇒ String
deprecated
Deprecated.
Please use #expires_at instead.
- #expires_on=(expiration_date) ⇒ Object
-
#initialize(attributes = {}) ⇒ Domain
constructor
A new instance of Domain.
Constructor Details
#initialize(attributes = {}) ⇒ Domain
Returns a new instance of Domain.
8 9 10 11 12 |
# File 'lib/dnsimple/struct/domain.rb', line 8 def initialize(attributes = {}) attributes.delete("expires_on") super @expires_on = Date.parse(expires_at).to_s if expires_at end |
Instance Attribute Details
#account_id ⇒ Integer
Returns The associated account ID.
18 19 20 |
# File 'lib/dnsimple/struct/domain.rb', line 18 def account_id @account_id end |
#auto_renew ⇒ Bool
Returns True if the domain is set to auto-renew, false otherwise.
33 34 35 |
# File 'lib/dnsimple/struct/domain.rb', line 33 def auto_renew @auto_renew end |
#created_at ⇒ String
Returns When the domain was created in DNSimple.
42 43 44 |
# File 'lib/dnsimple/struct/domain.rb', line 42 def created_at @created_at end |
#expires_at ⇒ String
Returns The timestamp when domain will expire.
39 40 41 |
# File 'lib/dnsimple/struct/domain.rb', line 39 def expires_at @expires_at end |
#id ⇒ Integer
Returns The domain ID in DNSimple.
15 16 17 |
# File 'lib/dnsimple/struct/domain.rb', line 15 def id @id end |
#name ⇒ String
Returns The domain name.
24 25 26 |
# File 'lib/dnsimple/struct/domain.rb', line 24 def name @name end |
#private_whois ⇒ Bool
Returns True if the domain WHOIS privacy is enabled, false otherwise.
36 37 38 |
# File 'lib/dnsimple/struct/domain.rb', line 36 def private_whois @private_whois end |
#registrant_id ⇒ Integer
Returns The associated registrant (contact) ID.
21 22 23 |
# File 'lib/dnsimple/struct/domain.rb', line 21 def registrant_id @registrant_id end |
#state ⇒ String
Returns The domain state.
30 31 32 |
# File 'lib/dnsimple/struct/domain.rb', line 30 def state @state end |
#token ⇒ String
Returns The domain API token used for domain authentication.
27 28 29 |
# File 'lib/dnsimple/struct/domain.rb', line 27 def token @token end |
#updated_at ⇒ String
Returns When the domain was last updated in DNSimple.
45 46 47 |
# File 'lib/dnsimple/struct/domain.rb', line 45 def updated_at @updated_at end |
Instance Method Details
#expires_on ⇒ String
Please use #expires_at instead.
Returns The date the domain will expire.
49 50 51 52 |
# File 'lib/dnsimple/struct/domain.rb', line 49 def expires_on warn "[DEPRECATION] Domain#expires_on is deprecated. Please use `expires_at` instead." @expires_on end |
#expires_on=(expiration_date) ⇒ Object
54 55 56 57 |
# File 'lib/dnsimple/struct/domain.rb', line 54 def expires_on=(expiration_date) warn "[DEPRECATION] Domain#expires_on= is deprecated. Please use `expires_at=` instead." @expires_on = expiration_date end |