Class: CodeclimateCi::GetGpa

Inherits:
Object
  • Object
show all
Defined in:
lib/codeclimate_ci/get_gpa.rb

Constant Summary collapse

NULL_VALUE =
0

Instance Method Summary collapse

Constructor Details

#initialize(api_requester, branch) ⇒ GetGpa

Returns a new instance of GetGpa.



5
6
7
# File 'lib/codeclimate_ci/get_gpa.rb', line 5

def initialize(api_requester, branch)
  @api_requester, @branch = api_requester, branch
end

Instance Method Details

#gpaObject



9
10
11
12
13
14
15
16
# File 'lib/codeclimate_ci/get_gpa.rb', line 9

def gpa
  retry_count.times do
    return last_snapshot_gpa if analyzed?
    wait_and_refresh!
  end

  NULL_VALUE
end