Class: Codestatus::PackageRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/codestatus/package_repository.rb,
lib/codestatus/package_repository/github_repository.rb

Defined Under Namespace

Classes: GitHubRepository

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(github: nil) ⇒ PackageRepository

Returns a new instance of PackageRepository.



3
4
5
6
# File 'lib/codestatus/package_repository.rb', line 3

def initialize(github: nil)
  @github = GitHubRepository.new(github) if github
  # bitbucket, gitlab, ...
end

Instance Attribute Details

#githubObject (readonly)

Returns the value of attribute github.



8
9
10
# File 'lib/codestatus/package_repository.rb', line 8

def github
  @github
end

Instance Method Details

#statusObject



10
11
12
13
14
# File 'lib/codestatus/package_repository.rb', line 10

def status
  if github
    github.status # default branch's commit's status
  end
end