Class: MineSkin::CapeData
- Inherits:
-
Object
- Object
- MineSkin::CapeData
- Defined in:
- lib/mineskin/cape_data.rb
Instance Attribute Summary collapse
-
#cape ⇒ Object
Returns the value of attribute cape.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(filename) ⇒ CapeData
constructor
A new instance of CapeData.
Methods included from Extractor
Methods included from Unit
Constructor Details
#initialize(filename) ⇒ CapeData
Returns a new instance of CapeData.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mineskin/cape_data.rb', line 14 def initialize(filename) @image = Magick::Image.read(filename).first # rubocop:disable ConditionalAssignment if (@image.columns.to_f / @image.rows.to_f) == (22.0 / 17.0) @unit = (@image.columns / 22.0).ceil else @unit = (@image.columns / 64.0).ceil end extract_cape! end |
Instance Attribute Details
#cape ⇒ Object
Returns the value of attribute cape.
11 12 13 |
# File 'lib/mineskin/cape_data.rb', line 11 def cape @cape end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
12 13 14 |
# File 'lib/mineskin/cape_data.rb', line 12 def unit @unit end |