Class: Gh::Trending::Repository
- Inherits:
-
Object
- Object
- Gh::Trending::Repository
- Defined in:
- lib/gh_trending/repository.rb
Overview
This class represents a trending repository in the github’s trending repositories page.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#period_stars ⇒ Object
readonly
Returns the value of attribute period_stars.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(name: nil, description: nil, language: nil, period_stars: nil, url: nil) ⇒ Repository
constructor
Period stars correspond to the stars that the repository has in the current period being considered, for example: 283 stars THIS WEEK.
- #to_h ⇒ Object
Constructor Details
#initialize(name: nil, description: nil, language: nil, period_stars: nil, url: nil) ⇒ Repository
Period stars correspond to the stars that the repository has in the current period being considered, for example: 283 stars THIS WEEK.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/gh_trending/repository.rb', line 9 def initialize( name: nil, description: nil, language: nil, period_stars: nil, url: nil ) @name = name || '' @description = description || '' @language = language || '' @period_stars = period_stars || 0 @url = url || '' end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/gh_trending/repository.rb', line 6 def description @description end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
6 7 8 |
# File 'lib/gh_trending/repository.rb', line 6 def language @language end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/gh_trending/repository.rb', line 6 def name @name end |
#period_stars ⇒ Object (readonly)
Returns the value of attribute period_stars.
6 7 8 |
# File 'lib/gh_trending/repository.rb', line 6 def period_stars @period_stars end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/gh_trending/repository.rb', line 6 def url @url end |
Instance Method Details
#to_h ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/gh_trending/repository.rb', line 23 def to_h { name: name, description: description, language: language, period_stars: period_stars, url: url } end |