Class: Hokusai::Commands::Base
- Inherits:
-
Object
- Object
- Hokusai::Commands::Base
show all
- Defined in:
- ui/src/hokusai/commands/base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.draw ⇒ Object
9
10
11
|
# File 'ui/src/hokusai/commands/base.rb', line 9
def self.draw
@draw
end
|
.on_draw(&block) ⇒ Object
5
6
7
|
# File 'ui/src/hokusai/commands/base.rb', line 5
def self.on_draw(&block)
@draw = block
end
|
Instance Method Details
#after_draw(canvas) ⇒ Object
19
20
|
# File 'ui/src/hokusai/commands/base.rb', line 19
def after_draw(canvas)
end
|
#draw ⇒ Object
13
14
15
16
17
|
# File 'ui/src/hokusai/commands/base.rb', line 13
def draw
raise Hokusai::Error.new("No draw callback made for #{self.class}") if self.class.draw.nil?
self.class.draw.call(self.freeze)
end
|