Class: Github::Developer
- Inherits:
-
Object
- Object
- Github::Developer
- Defined in:
- lib/gitget/github_developer.rb
Overview
Main class to set up a Github User
Instance Attribute Summary collapse
-
#followers ⇒ Object
readonly
Returns the value of attribute followers.
-
#following ⇒ Object
readonly
Returns the value of attribute following.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#public_repos ⇒ Object
readonly
Returns the value of attribute public_repos.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data:) ⇒ Developer
constructor
A new instance of Developer.
- #repos ⇒ Object
Constructor Details
#initialize(data:) ⇒ Developer
Returns a new instance of Developer.
8 9 10 11 12 |
# File 'lib/gitget/github_developer.rb', line 8 def initialize(data:) @name = data['login'] @id = data['id'] @public_repos = data['public_repos'] end |
Instance Attribute Details
#followers ⇒ Object (readonly)
Returns the value of attribute followers.
6 7 8 |
# File 'lib/gitget/github_developer.rb', line 6 def followers @followers end |
#following ⇒ Object (readonly)
Returns the value of attribute following.
6 7 8 |
# File 'lib/gitget/github_developer.rb', line 6 def following @following end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/gitget/github_developer.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/gitget/github_developer.rb', line 6 def name @name end |
#public_repos ⇒ Object (readonly)
Returns the value of attribute public_repos.
6 7 8 |
# File 'lib/gitget/github_developer.rb', line 6 def public_repos @public_repos end |
Class Method Details
Instance Method Details
#repos ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/gitget/github_developer.rb', line 14 def repos return @repos if @repos @repos = Github::API.user_repos(@name).map do |repo_data| Github::Repository.new(data: repo_data) end end |