Class: Hiptest::Nodes::TypeWriter

Inherits:
Walker
  • Object
show all
Defined in:
lib/hiptest-publisher/parameter_type_adder.rb

Instance Method Summary collapse

Methods inherited from Walker

#walk_node

Constructor Details

#initialize(call_types) ⇒ TypeWriter

Returns a new instance of TypeWriter.



52
53
54
55
56
# File 'lib/hiptest-publisher/parameter_type_adder.rb', line 52

def initialize(call_types)
  super(:parent_first)
  @call_types = call_types
  @callable_item_name = nil
end

Instance Method Details

#walk_actionword(actionword) ⇒ Object



58
59
60
# File 'lib/hiptest-publisher/parameter_type_adder.rb', line 58

def walk_actionword actionword
  @callable_item_name = actionword.children[:name]
end

#walk_parameter(parameter) ⇒ Object



66
67
68
# File 'lib/hiptest-publisher/parameter_type_adder.rb', line 66

def walk_parameter parameter
  parameter.children[:type] = @call_types.type_of(@callable_item_name, parameter.children[:name])
end

#walk_scenario(scenario) ⇒ Object



62
63
64
# File 'lib/hiptest-publisher/parameter_type_adder.rb', line 62

def walk_scenario(scenario)
  @callable_item_name = scenario.children[:name]
end