Class: DNSimple::User

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

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DNSimple::Base

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



6
7
8
# File 'lib/dnsimple/user.rb', line 6

def created_at
  @created_at
end

#domain_countObject

Returns the value of attribute domain_count.



16
17
18
# File 'lib/dnsimple/user.rb', line 16

def domain_count
  @domain_count
end

#domain_limitObject

Returns the value of attribute domain_limit.



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

def domain_limit
  @domain_limit
end

#emailObject

Returns the value of attribute email.



10
11
12
# File 'lib/dnsimple/user.rb', line 10

def email
  @email
end

#failed_login_countObject

Returns the value of attribute failed_login_count.



14
15
16
# File 'lib/dnsimple/user.rb', line 14

def 
  @failed_login_count
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/dnsimple/user.rb', line 4

def id
  @id
end

#login_countObject

Returns the value of attribute login_count.



12
13
14
# File 'lib/dnsimple/user.rb', line 12

def 
  @login_count
end

#updated_atObject

Returns the value of attribute updated_at.



8
9
10
# File 'lib/dnsimple/user.rb', line 8

def updated_at
  @updated_at
end

Class Method Details

.me(options = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/dnsimple/user.rb', line 20

def self.me(options={})
  response = DNSimple::Client.get("users/me", options)

  case response.code
  when 200
    new(response["user"])
  when 404
    raise RecordNotFound, "Could not find account with current credentials"
  else
    raise RequestError.new("Error finding account", response)
  end
end