class Metamatter::License

Attributes

repository[RW]

Public Class Methods

new(repository) click to toggle source
# File lib/metamatter/license.rb, line 9
def initialize(repository)
  @repository = repository
end

Public Instance Methods

github_response() click to toggle source
# File lib/metamatter/license.rb, line 28
def github_response
  @github_response ||= client.repository(repository.name_with_owner)
end
has_license?() click to toggle source
# File lib/metamatter/license.rb, line 13
def has_license?
  !github_response.license.nil?
end
license() click to toggle source
# 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