Class: Hiptest::SignatureExporter

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.export_actionwords(project, export_nodes = false) ⇒ Object



5
6
7
8
# File 'lib/hiptest-publisher/signature_exporter.rb', line 5

def self.export_actionwords(project, export_nodes = false)
  exporter = SignatureExporter.new
  exporter.export_actionwords(project.children[:actionwords], export_nodes)
end

Instance Method Details

#export_actionwords(aws, export_nodes = false) ⇒ Object



10
11
12
# File 'lib/hiptest-publisher/signature_exporter.rb', line 10

def export_actionwords(aws, export_nodes = false)
  aws.children[:actionwords].map {|aw| export_actionword(aw, export_nodes)}
end

#export_item(item, export_node = false) ⇒ Object Also known as: export_actionword, export_scenario



14
15
16
17
18
19
20
21
22
# File 'lib/hiptest-publisher/signature_exporter.rb', line 14

def export_item(item, export_node = false)
  hash = {
    'name' => item.children[:name],
    'uid' => item.children[:uid],
    'parameters' => export_parameters(item)
  }
  hash['node'] = item if export_node
  hash
end

#export_parameter(parameter) ⇒ Object



30
31
32
33
34
# File 'lib/hiptest-publisher/signature_exporter.rb', line 30

def export_parameter(parameter)
  {
    'name' => parameter.children[:name]
  }
end

#export_parameters(item) ⇒ Object



26
27
28
# File 'lib/hiptest-publisher/signature_exporter.rb', line 26

def export_parameters(item)
  item.children[:parameters].map {|p| export_parameter(p)}
end