Class: MineSkin::SkinData
- Inherits:
-
Object
- Object
- MineSkin::SkinData
- Defined in:
- lib/mineskin/skin_data.rb
Overview
Skin Data class
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#head ⇒ Object
Returns the value of attribute head.
-
#left_arm ⇒ Object
Returns the value of attribute left_arm.
-
#left_leg ⇒ Object
Returns the value of attribute left_leg.
-
#right_arm ⇒ Object
Returns the value of attribute right_arm.
-
#right_leg ⇒ Object
Returns the value of attribute right_leg.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(filename) ⇒ SkinData
constructor
rubocop:disable AbcSize Initializes new instance of SkinData.
- #new_format? ⇒ Boolean
Methods included from Extractor
Methods included from Unit
Constructor Details
#initialize(filename) ⇒ SkinData
rubocop:disable AbcSize Initializes new instance of SkinData
28 29 30 31 32 33 34 35 36 |
# File 'lib/mineskin/skin_data.rb', line 28 def initialize(filename) @image = Magick::Image.read(filename).first @new_format = @image.columns == @image.rows @unit = image_unit size: @image.columns @head = extract_head @body = extract_body @left_leg, @right_leg = extract_legs @left_arm, @right_arm = extract_arms end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
12 13 14 |
# File 'lib/mineskin/skin_data.rb', line 12 def body @body end |
#head ⇒ Object
Returns the value of attribute head.
12 13 14 |
# File 'lib/mineskin/skin_data.rb', line 12 def head @head end |
#left_arm ⇒ Object
Returns the value of attribute left_arm.
12 13 14 |
# File 'lib/mineskin/skin_data.rb', line 12 def left_arm @left_arm end |
#left_leg ⇒ Object
Returns the value of attribute left_leg.
12 13 14 |
# File 'lib/mineskin/skin_data.rb', line 12 def left_leg @left_leg end |
#right_arm ⇒ Object
Returns the value of attribute right_arm.
12 13 14 |
# File 'lib/mineskin/skin_data.rb', line 12 def right_arm @right_arm end |
#right_leg ⇒ Object
Returns the value of attribute right_leg.
12 13 14 |
# File 'lib/mineskin/skin_data.rb', line 12 def right_leg @right_leg end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
20 21 22 |
# File 'lib/mineskin/skin_data.rb', line 20 def unit @unit end |
Instance Method Details
#new_format? ⇒ Boolean
21 22 23 |
# File 'lib/mineskin/skin_data.rb', line 21 def new_format? @new_format end |