Class: Inch::Badge::Image::Base
- Inherits:
-
Object
- Object
- Inch::Badge::Image::Base
- Defined in:
- lib/inch/badge/image/base.rb
Instance Attribute Summary collapse
-
#style ⇒ Object
readonly
Returns the value of attribute style.
Instance Method Summary collapse
-
#initialize(filename, numbers, style = :default) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(filename, numbers, style = :default) ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 12 13 14 15 |
# File 'lib/inch/badge/image/base.rb', line 7 def initialize(filename, numbers, style = :default) @filename = filename @numbers = numbers.map(&:to_i) @style = style @overall = @numbers.inject(0, :+) @grades = Config::GRADE_ORDER.map.with_index do |name, index| GradeSection.new(name, Config::GRADE_COLOR[index], @numbers[index], @overall) end end |
Instance Attribute Details
#style ⇒ Object (readonly)
Returns the value of attribute style.
5 6 7 |
# File 'lib/inch/badge/image/base.rb', line 5 def style @style end |