Class: Jsm::Drawer::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/jsm/drawer/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Node

Returns a new instance of Node.



3
4
5
6
7
# File 'lib/jsm/drawer/node.rb', line 3

def initialize(params = {})
  @from = params[:from]
  @to = params[:to]
  @label = params[:label]
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



2
3
4
# File 'lib/jsm/drawer/node.rb', line 2

def from
  @from
end

#labelObject (readonly)

Returns the value of attribute label.



2
3
4
# File 'lib/jsm/drawer/node.rb', line 2

def label
  @label
end

#toObject (readonly)

Returns the value of attribute to.



2
3
4
# File 'lib/jsm/drawer/node.rb', line 2

def to
  @to
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/jsm/drawer/node.rb', line 9

def to_s
  "#{from.to_s}->#{to.to_s}[label=#{label.to_s}]"
end