Class: User
- Inherits:
-
GithubConnection
- Object
- GithubConnection
- User
- Defined in:
- lib/gitwrap/users.rb
Constant Summary
Constants inherited from GithubConnection
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ User
constructor
A new instance of User.
Methods included from DataCreator
#create_many_orgs, #create_many_repos, #create_many_users, #create_org, #create_org_repos, #create_single_repo, #create_user, #create_user_repos, #parse_data
Constructor Details
#initialize(hash) ⇒ User
Returns a new instance of User.
5 6 7 8 9 10 |
# File 'lib/gitwrap/users.rb', line 5 def initialize(hash) @name = hash['name'] @location = hash['location'] @email = hash['email'] @username = hash['login'] end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
2 3 4 |
# File 'lib/gitwrap/users.rb', line 2 def email @email end |
#location ⇒ Object
Returns the value of attribute location.
2 3 4 |
# File 'lib/gitwrap/users.rb', line 2 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/gitwrap/users.rb', line 2 def name @name end |
#username ⇒ Object
Returns the value of attribute username.
2 3 4 |
# File 'lib/gitwrap/users.rb', line 2 def username @username end |
Class Method Details
.fetch_all_users ⇒ Object
16 17 18 19 20 |
# File 'lib/gitwrap/users.rb', line 16 def self.fetch_all_users $all_users = User.new({}).create_many_users("#{BASE_URL}users?since=#{$current_id}") $current_id += $all_users.length-1 $all_users end |
.fetch_single_user(username) ⇒ Object
12 13 14 |
# File 'lib/gitwrap/users.rb', line 12 def self.fetch_single_user(username) user = User.new({}).create_user("#{BASE_URL}users/#{username}") end |