Class: Hokusai::Commands::Image
- Defined in:
- ui/src/hokusai/commands/image.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #cache ⇒ Object
- #hash ⇒ Object
-
#initialize(source, x, y, width, height) ⇒ Image
constructor
A new instance of Image.
Methods inherited from Base
#after_draw, draw, #draw, on_draw
Constructor Details
#initialize(source, x, y, width, height) ⇒ Image
Returns a new instance of Image.
5 6 7 8 9 10 11 |
# File 'ui/src/hokusai/commands/image.rb', line 5 def initialize(source, x, y, width, height) @source = source @x = x @y = y @width = width @height = height end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
3 4 5 |
# File 'ui/src/hokusai/commands/image.rb', line 3 def height @height end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
3 4 5 |
# File 'ui/src/hokusai/commands/image.rb', line 3 def source @source end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
3 4 5 |
# File 'ui/src/hokusai/commands/image.rb', line 3 def width @width end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
3 4 5 |
# File 'ui/src/hokusai/commands/image.rb', line 3 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
3 4 5 |
# File 'ui/src/hokusai/commands/image.rb', line 3 def y @y end |
Instance Method Details
#cache ⇒ Object
17 18 19 |
# File 'ui/src/hokusai/commands/image.rb', line 17 def cache [source, width, height].hash end |
#hash ⇒ Object
13 14 15 |
# File 'ui/src/hokusai/commands/image.rb', line 13 def hash [self.class, x, y, width, height, source].hash end |