Class: GuidedPath::GotoNode

Inherits:
Node
  • Object
show all
Defined in:
lib/guided_path/goto_node.rb

Instance Attribute Summary

Attributes inherited from Node

#label, #next_node

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ GotoNode

Returns a new instance of GotoNode.



8
9
10
11
12
# File 'lib/guided_path/goto_node.rb', line 8

def initialize(args = {})
  super
  args = args.symbolize_keys
  raise("Must specify target for a goto node") if @next_node.empty?
end

Instance Method Details

#to_hashObject



15
16
17
18
19
20
# File 'lib/guided_path/goto_node.rb', line 15

def to_hash
  output = {}
  output = super
  output[:type] = 'goto'
  output
end