Class: OrigenTesters::Doc::Generator::Flow
Constant Summary
collapse
- OUTPUT_POSTFIX =
'flow'
- OUTPUT_EXTENSION =
'yaml'
Generator::FlowControlAPI::FLOW_METHODS, Generator::FlowControlAPI::RELATION_METHODS
Instance Method Summary
collapse
#apply_current_context!, #apply_relationships, #at_run_start, #conditionally_deactivated?, #confirm_valid_context, #context_changed?, #current_context, #extract_flow_control_options!, #extract_relation_options!, #finalize, #find_by_id, #generate_unique_label, #identity_map, #if_all_failed, #if_all_passed, #if_any_failed, #if_any_passed, #if_enable, #if_failed, #if_job, #if_passed, #if_ran, #record_id, #replace_context_with_current, #replace_relationship_dependent, #save_context, #summarize_context, #track_relationships, #unless_enable, #unless_job, #unless_ran
Methods included from Generator
#close, #collection, #collection=, #compiler, #current_dir, #dont_diff=, execute_source, #file_extension, #file_pipeline, #filename, #filename=, #finalize, #identity_map, #import, #inhibit_output, #on_close, #output_file, #output_inhibited?, #platform, #reference_file, #set_flow_description, #stats, #to_be_written?, #write_from_template, #write_to_file
Instance Method Details
#add(type, options = {}) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/origen_testers/doc/generator/flow.rb', line 11
def add(type, options = {})
= options.delete(:preserve_comments)
line = track_relationships(options) do |options|
FlowLine.new(type, options)
end
collection << line unless Origen.interface.resources_mode?
if
line.description = Origen.interface.
else
line.description = Origen.interface.
end
line
end
|
#render(file, options = {}) ⇒ Object
53
54
55
56
|
# File 'lib/origen_testers/doc/generator/flow.rb', line 53
def render(file, options = {})
options[:file] = file
add(:render, options)
end
|
#set_device(options = {}) ⇒ Object
45
46
47
|
# File 'lib/origen_testers/doc/generator/flow.rb', line 45
def set_device(options = {})
add(:set_device, options)
end
|
#skip(identifier = nil, options = {}) ⇒ Object
58
59
60
61
62
63
64
65
|
# File 'lib/origen_testers/doc/generator/flow.rb', line 58
def skip(identifier = nil, options = {})
identifier, options = nil, identifier if identifier.is_a?(Hash)
identifier = generate_unique_label(identifier)
options[:test] = identifier
add(:branch, options)
yield
add(:label, test: identifier)
end
|
#start_section(options = {}) ⇒ Object
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/origen_testers/doc/generator/flow.rb', line 25
def start_section(options = {})
l = FlowLine.new(:section_start, options)
if options[:name]
desc = [options[:name]]
else
desc = []
end
l.description = desc + Origen.interface.
collection << l
end
|
#stop_section(options = {}) ⇒ Object
36
37
38
|
# File 'lib/origen_testers/doc/generator/flow.rb', line 36
def stop_section(options = {})
collection << FlowLine.new(:section_stop, options)
end
|
#test(instance, options = {}) ⇒ Object
40
41
42
43
|
# File 'lib/origen_testers/doc/generator/flow.rb', line 40
def test(instance, options = {})
options = save_context(options)
add(:test, { test: instance }.merge(options))
end
|
#to_yaml(options = {}) ⇒ Object
49
50
51
|
# File 'lib/origen_testers/doc/generator/flow.rb', line 49
def to_yaml(options = {})
collection.map { |l| l.to_yaml(options) }
end
|