Class: Dnsimple::Struct::Domain

Inherits:
Base
  • Object
show all
Defined in:
lib/dnsimple/struct/domain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idInteger

Returns The associated account ID.

Returns:

  • (Integer)

    The associated account ID.



18
19
20
# File 'lib/dnsimple/struct/domain.rb', line 18

def 
  @account_id
end

#auto_renewBool

Returns True if the domain is set to auto-renew, false otherwise.

Returns:

  • (Bool)

    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_atString

Returns When the domain was created in DNSimple.

Returns:

  • (String)

    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_atString

Returns The timestamp when domain will expire.

Returns:

  • (String)

    The timestamp when domain will expire.



39
40
41
# File 'lib/dnsimple/struct/domain.rb', line 39

def expires_at
  @expires_at
end

#idInteger

Returns The domain ID in DNSimple.

Returns:

  • (Integer)

    The domain ID in DNSimple.



15
16
17
# File 'lib/dnsimple/struct/domain.rb', line 15

def id
  @id
end

#nameString

Returns The domain name.

Returns:

  • (String)

    The domain name.



24
25
26
# File 'lib/dnsimple/struct/domain.rb', line 24

def name
  @name
end

#private_whoisBool

Returns True if the domain WHOIS privacy is enabled, false otherwise.

Returns:

  • (Bool)

    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_idInteger

Returns The associated registrant (contact) ID.

Returns:

  • (Integer)

    The associated registrant (contact) ID.



21
22
23
# File 'lib/dnsimple/struct/domain.rb', line 21

def registrant_id
  @registrant_id
end

#stateString

Returns The domain state.

Returns:

  • (String)

    The domain state.



30
31
32
# File 'lib/dnsimple/struct/domain.rb', line 30

def state
  @state
end

#tokenString

Returns The domain API token used for domain authentication.

Returns:

  • (String)

    The domain API token used for domain authentication.



27
28
29
# File 'lib/dnsimple/struct/domain.rb', line 27

def token
  @token
end

#updated_atString

Returns When the domain was last updated in DNSimple.

Returns:

  • (String)

    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_onString

Deprecated.

Please use #expires_at instead.

Returns The date the domain will expire.

Returns:

  • (String)

    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