Class: Githubris::User

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ User

Returns a new instance of User.



2
3
4
# File 'lib/githubris/user.rb', line 2

def initialize attributes={}
  @attributes = attributes
end

Instance Method Details

#==(other) ⇒ Object



30
31
32
33
34
35
# File 'lib/githubris/user.rb', line 30

def == other
  other_attrs = other.instance_variable_get(:@attributes)
  if other_attrs
    @attributes == other_attrs
  end
end

#avatar_urlObject



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

def avatar_url
  @attributes[:avatar_url]
end

#gravatar_idObject



26
27
28
# File 'lib/githubris/user.rb', line 26

def gravatar_id
  @attributes[:gravatar_id]
end

#idObject



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

def id
  @attributes[:id]
end

#loginObject



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

def 
  @attributes[:login]
end

#public_gistsObject



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

def public_gists
  Githubris::API.new.get_user_public_gists(@attributes[:login])
end

#urlObject



22
23
24
# File 'lib/githubris/user.rb', line 22

def url
  @attributes[:url]
end