Class: Metamatter::License
- Inherits:
-
Object
- Object
- Metamatter::License
- Includes:
- Helpers
- Defined in:
- lib/metamatter/license.rb
Constant Summary
Constants included from Helpers
Instance Attribute Summary collapse
-
#repository ⇒ Object
Returns the value of attribute repository.
Instance Method Summary collapse
- #github_response ⇒ Object
- #has_license? ⇒ Boolean
-
#initialize(repository) ⇒ License
constructor
A new instance of License.
- #license ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(repository) ⇒ License
Returns a new instance of License.
9 10 11 |
# File 'lib/metamatter/license.rb', line 9 def initialize(repository) @repository = repository end |
Instance Attribute Details
#repository ⇒ Object
Returns the value of attribute repository.
7 8 9 |
# File 'lib/metamatter/license.rb', line 7 def repository @repository end |
Instance Method Details
#github_response ⇒ Object
28 29 30 |
# File 'lib/metamatter/license.rb', line 28 def github_response @github_response ||= client.repository(repository.name_with_owner) end |
#has_license? ⇒ Boolean
13 14 15 |
# File 'lib/metamatter/license.rb', line 13 def has_license? !github_response.license.nil? end |
#license ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/metamatter/license.rb', line 17 def license if has_license? { :name => github_response.license.name, :url => github_response.license.url } else return nil end end |