class Markdoc::Sequence::Role

Attributes

border[RW]
column[RW]
fill[RW]
font[RW]
height[RW]
id[RW]
label[RW]
line[RW]
messages[RW]
offsetx[RW]
offsety[RW]
prev[RW]
radius[RW]
spacing[RW]
succ[RW]
width[RW]

Public Class Methods

new(args) click to toggle source
# File lib/markdoc/sequence.rb, line 44
def initialize(args)
  self.messages = []
  self.id = args[:id].strip
  self.label = args[:label].strip

  # ui settings
  self.column = args[:column]
  self.offsetx = args[:diagram][:offsetx]
  self.offsety = args[:diagram][:offsety]
  self.border = args[:ui][:border]
  self.fill = args[:ui][:fill]
  self.radius = args[:ui][:radius]
  self.spacing = args[:ui][:spacing]
  self.width = args[:ui][:width]
  self.height = args[:ui][:height]
  self.line = args[:ui][:line]
  self.font = args[:ui][:font]
end

Public Instance Methods

<=>(o) click to toggle source
# File lib/markdoc/sequence.rb, line 63
def <=> o
  column <=> o.column
end
center() click to toggle source
# File lib/markdoc/sequence.rb, line 82
def center
  x + width/2
end
print() click to toggle source
type() click to toggle source
# File lib/markdoc/sequence.rb, line 67
def type
  case label
  when /actor/i
    :actor
  when /database/i
    :database
  when /site|web/i
    :website
  when /application|system/i
    :system
  else
    :component
  end
end
x() click to toggle source
# File lib/markdoc/sequence.rb, line 86
def x
  offsetx + column*(width + spacing)
end
y() click to toggle source
# File lib/markdoc/sequence.rb, line 90
def y
  offsety
end