Class: Jsm::Drawer::Node
- Inherits:
-
Object
- Object
- Jsm::Drawer::Node
- Defined in:
- lib/jsm/drawer/node.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Node
constructor
A new instance of Node.
- #to_s ⇒ Object
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
#from ⇒ Object (readonly)
Returns the value of attribute from.
2 3 4 |
# File 'lib/jsm/drawer/node.rb', line 2 def from @from end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
2 3 4 |
# File 'lib/jsm/drawer/node.rb', line 2 def label @label end |
#to ⇒ Object (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_s ⇒ Object
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 |