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.



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

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

Class Method Details

.add(project) ⇒ Object



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

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

Instance Method Details

#update_all_callsObject



16
17
18
19
# File 'lib/hiptest-publisher/node_modifiers/call_arguments_adder.rb', line 16

def update_all_calls
  update_calls
  update_uid_calls
end

#update_callsObject



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

def update_calls
  @project.each_sub_nodes(Hiptest::Nodes::Call) do |call|
    update_call(call, @indexer.get_index(call.children[:actionword]))
  end
end

#update_uid_callsObject



27
28
29
30
31
# File 'lib/hiptest-publisher/node_modifiers/call_arguments_adder.rb', line 27

def update_uid_calls
  @project.each_sub_nodes(Hiptest::Nodes::UIDCall) do |uid_call|
    update_call(uid_call, @indexer.get_uid_index(uid_call.children[:uid]))
  end
end