Class: GuidedPath::LeadInNode

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

Instance Attribute Summary collapse

Attributes inherited from Node

#label, #next_node

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ LeadInNode

Returns a new instance of LeadInNode.

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
# File 'lib/guided_path/lead_in_node.rb', line 9

def initialize(args = {})
  super
  args = args.symbolize_keys

  raise(ArgumentError, "Must specify a value for the node") unless args[:text]
  @text = args[:text].to_s
  @pause = args[:pause].to_s
end

Instance Attribute Details

#pauseObject (readonly)

Returns the value of attribute pause.



7
8
9
# File 'lib/guided_path/lead_in_node.rb', line 7

def pause
  @pause
end

#textObject (readonly)

Returns the value of attribute text.



7
8
9
# File 'lib/guided_path/lead_in_node.rb', line 7

def text
  @text
end

Instance Method Details

#to_hashObject



19
20
21
22
23
24
25
# File 'lib/guided_path/lead_in_node.rb', line 19

def to_hash
  output = super
  output[:type] = 'leadin'
  output[:text] = @text
  output[:pause] = @pause
  output
end