Class: Yuimaru::Sequence::Diagram

Inherits:
Object
  • Object
show all
Defined in:
lib/yuimaru/sequence/diagram.rb

Constant Summary collapse

HAND_FAMILY =
'Daniel'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sequence) ⇒ Diagram

Returns a new instance of Diagram.



10
11
12
# File 'lib/yuimaru/sequence/diagram.rb', line 10

def initialize(sequence)
  @sequence = sequence
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



8
9
10
# File 'lib/yuimaru/sequence/diagram.rb', line 8

def context
  @context
end

#heightObject (readonly)

Returns the value of attribute height.



8
9
10
# File 'lib/yuimaru/sequence/diagram.rb', line 8

def height
  @height
end

#surfaceObject (readonly)

Returns the value of attribute surface.



8
9
10
# File 'lib/yuimaru/sequence/diagram.rb', line 8

def surface
  @surface
end

#widthObject (readonly)

Returns the value of attribute width.



8
9
10
# File 'lib/yuimaru/sequence/diagram.rb', line 8

def width
  @width
end

Instance Method Details

#draw {|surface| ... } ⇒ Object

Yields:



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/yuimaru/sequence/diagram.rb', line 14

def draw
  set_layout
  init_surface
  init_context
  set_font
  fill_background

  draw_actors
  draw_lifeline
  draw_messages

  yield surface
end