Class: Sleet::Branch

Inherits:
Object
  • Object
show all
Defined in:
lib/sleet/branch.rb

Instance Method Summary collapse

Constructor Details

#initialize(circle_ci_token:, github_user:, github_repo:, branch:) ⇒ Branch

Returns a new instance of Branch.



5
6
7
8
9
10
# File 'lib/sleet/branch.rb', line 5

def initialize(circle_ci_token:, github_user:, github_repo:, branch:)
  @circle_ci_token = circle_ci_token
  @github_user = github_user
  @github_repo = github_repo
  @branch = CGI.escape(branch)
end

Instance Method Details

#buildsObject



12
13
14
# File 'lib/sleet/branch.rb', line 12

def builds
  @builds ||= JSON.parse(Sleet::CircleCi.get(url, circle_ci_token).body)
end