Class: Hiptest::NodeModifiers::DefaultArgumentAdder

Inherits:
Object
  • Object
show all
Defined in:
lib/hiptest-publisher/node_modifiers/call_arguments_adder.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ DefaultArgumentAdder

Returns a new instance of DefaultArgumentAdder.



12
13
14
15
16
# File 'lib/hiptest-publisher/node_modifiers/call_arguments_adder.rb', line 12

def initialize(project)
  @project = project
  @library_indexer = LibraryActionwordIndexer.new(project)
  @indexer = ActionwordIndexer.new(project)
end

Class Method Details

.add(project) ⇒ Object



8
9
10
# File 'lib/hiptest-publisher/node_modifiers/call_arguments_adder.rb', line 8

def self.add(project)
  self.new(project).update_calls
end

Instance Method Details

#update_callsObject



18
19
20
21
22
23
24
25
# File 'lib/hiptest-publisher/node_modifiers/call_arguments_adder.rb', line 18

def update_calls
  @project.each_sub_nodes(Hiptest::Nodes::Call) do |call|
    actionword = @library_indexer.get_index(call.children[:actionword])
    actionword = @indexer.get_index(call.children[:actionword]) if actionword.nil?

    update_call(call, actionword)
  end
end