Class: Dieses::Application::Pen

Inherits:
Object
  • Object
show all
Defined in:
lib/dieses/application/pen.rb

Defined Under Namespace

Classes: Draw

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(canvas) ⇒ Pen

Returns a new instance of Pen.



8
9
10
# File 'lib/dieses/application/pen.rb', line 8

def initialize(canvas)
  @canvas = canvas
end

Instance Attribute Details

#canvasObject (readonly)

Returns the value of attribute canvas.



6
7
8
# File 'lib/dieses/application/pen.rb', line 6

def canvas
  @canvas
end

Instance Method Details

#draw(unit:, multiple: 1, &block) ⇒ Object



12
13
14
# File 'lib/dieses/application/pen.rb', line 12

def draw(unit:, multiple: 1, &block)
  Draw.(self, Ruler.(unit, multiple), &block)
end