Class: Deliverhq::Domain

Inherits:
Object
  • Object
show all
Defined in:
lib/deliverhq/models/domain.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Domain

Returns a new instance of Domain.



6
7
8
9
10
11
12
# File 'lib/deliverhq/models/domain.rb', line 6

def initialize(params)
  @id = params['id']
  @account_id = params['account_id']
  @name = params['name']
  @verification_token = params['verification_token']
  @verified_at = params['verified_at']
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



4
5
6
# File 'lib/deliverhq/models/domain.rb', line 4

def 
  @account_id
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/deliverhq/models/domain.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/deliverhq/models/domain.rb', line 4

def name
  @name
end

#verification_tokenObject (readonly)

Returns the value of attribute verification_token.



4
5
6
# File 'lib/deliverhq/models/domain.rb', line 4

def verification_token
  @verification_token
end

#verified_atObject (readonly)

Returns the value of attribute verified_at.



4
5
6
# File 'lib/deliverhq/models/domain.rb', line 4

def verified_at
  @verified_at
end

Class Method Details

.allObject



18
19
20
21
22
# File 'lib/deliverhq/models/domain.rb', line 18

def self.all
  Request::Domain.list.collect do |domain|
    new domain
  end
end

.create(params) ⇒ Object



14
15
16
# File 'lib/deliverhq/models/domain.rb', line 14

def self.create(params)
  new(Request::Domain.create(params))
end

Instance Method Details

#destroyObject



24
25
26
# File 'lib/deliverhq/models/domain.rb', line 24

def destroy
  Request::Domain.destroy(id)
end