Sha256: cd4d72ad74967ebd46125698faeaf450def5d69be21e7dfd927fed5f9c238fa8

Contents?: true

Size: 776 Bytes

Versions: 1

Compression:

Stored size: 776 Bytes

Contents

module Github
	class Repo
		attr_reader :info

		def initialize(repo_info, token)
			store(repo_info)
			store_token(token)
		end

		def language
			@info['language']
		end

		def name 
			@info['name']
		end

		def owner_login
			@info['owner']['login']
		end

		def forked?
			@info['fork']
		end

		def url
			@info['html_url']
		end

		def commits_url 
			@info['commits_url'].split('{')[0]
		end

		def languages_url
			@info['languages_url']
		end

		def access_token
			self.info['access_token']
		end

		def commits
			request(commits_url, access_token)
		end

		def languages
			request(languages_url, access_token)
		end

		private

		def store(repo)
			@info||={}
			@info.merge!(repo)
		end

		def store_token(token)
			@info['access_token'] = token
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git-layer-0.2.0 lib/github/repo.rb