class Inch::Badge::GradeSection

Public Instance Methods

prefix(x) click to toggle source
# File lib/inch/badge/grade_section.rb, line 4
def prefix(x)
  if x == 0
    "begin"
  elsif x == section_width - 1
    "end"
  else
    "body"
  end
end
section_width() click to toggle source
# File lib/inch/badge/grade_section.rb, line 19
def section_width
  Config::SECTION_WIDTH
end
width() click to toggle source
# File lib/inch/badge/grade_section.rb, line 14
def width
  return 0 if overall == 0
  ((size / overall.to_f) * section_width).round
end