Class: Logan::Person

Inherits:
Object
  • Object
show all
Includes:
HashConstructed, ResponseHandler
Defined in:
lib/logan/person.rb

Instance Attribute Summary collapse

Attributes included from HashConstructed

#attributes, #json_raw

Instance Method Summary collapse

Methods included from ResponseHandler

#handle_error, #handle_response, #success?

Methods included from HashConstructed

#initialize

Instance Attribute Details

#adminObject

Returns the value of attribute admin.



13
14
15
# File 'lib/logan/person.rb', line 13

def admin
  @admin
end

#avatar_urlObject

Returns the value of attribute avatar_url.



14
15
16
# File 'lib/logan/person.rb', line 14

def avatar_url
  @avatar_url
end

#created_atObject

Returns the value of attribute created_at.



15
16
17
# File 'lib/logan/person.rb', line 15

def created_at
  @created_at
end

#email_addressObject

Returns the value of attribute email_address.



12
13
14
# File 'lib/logan/person.rb', line 12

def email_address
  @email_address
end

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/logan/person.rb', line 9

def id
  @id
end

#identity_idObject

Returns the value of attribute identity_id.



10
11
12
# File 'lib/logan/person.rb', line 10

def identity_id
  @identity_id
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/logan/person.rb', line 11

def name
  @name
end

#updated_atObject

Returns the value of attribute updated_at.



16
17
18
# File 'lib/logan/person.rb', line 16

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url.



17
18
19
# File 'lib/logan/person.rb', line 17

def url
  @url
end

Instance Method Details

#projectsObject



23
24
25
26
# File 'lib/logan/person.rb', line 23

def projects
  response = Logan::Client.get "/people/#{@id}/projects.json"
  handle_response(response, Proc.new {|h| Logan::Project.new(h) })
end

#to_hashObject



19
20
21
# File 'lib/logan/person.rb', line 19

def to_hash
  { :id => @id, :type => "Person" }
end