Skip to content

Commit

Permalink
Decision - extract method record_count
Browse files Browse the repository at this point in the history
  • Loading branch information
asaf schers committed Mar 3, 2018
1 parent e5bc0b6 commit 4c6d855
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/scoruby/decision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ def initialize(xml)
def probability(score_distribution, xml)
probability = score_distribution.attributes['probability'].to_s
return probability.to_f if probability != ''
score_distribution.attributes['recordCount'].to_s.to_f / xml.attributes['recordCount'].to_s.to_f
record_count(score_distribution) / record_count(xml)
end

def record_count(xml)
xml.attributes['recordCount'].to_s.to_f
end
end
end

0 comments on commit 4c6d855

Please sign in to comment.