class Mscgen::Message

Constants

ALLOW_TYPE

acceptable allow type definition

Attributes

from[R]
label[R]
to[R]

Public Class Methods

new(from, to, label=nil, options={}) click to toggle source
from

a entity which message from

to

a entity which message to

label

message string

options

supports :type, :linecolor, :textcolor attributes

# File lib/mscgen/message.rb, line 22
def initialize(from, to, label=nil, options={})
  @from = from
  @to = to
  @label = Mscgen.escape(label.to_s) unless label.nil?
  @options = (options or {})
  raise ArgumentError unless @options.kind_of?(Hash)
  raise UnknownAllowType unless ALLOW_TYPE.has_key?(@options.fetch(:type, :method))
end

Public Instance Methods

to_msc() click to toggle source

return mscgen format text

# File lib/mscgen/message.rb, line 32
def to_msc
  message = "#{@from.name} #{allow} #{@to.name}"
  message += option_string
  message
end