Class: Hiptest::Nodes::Item
Direct Known Subclasses
Instance Attribute Summary collapse
-
#non_valued_parameters ⇒ Object
readonly
Returns the value of attribute non_valued_parameters.
-
#valued_parameters ⇒ Object
readonly
Returns the value of attribute valued_parameters.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Attributes inherited from Node
Instance Method Summary collapse
- #add_tags(tags) ⇒ Object
- #declared_variables_names ⇒ Object
-
#initialize(name, tags = [], description = '', parameters = [], body = []) ⇒ Item
constructor
A new instance of Item.
Methods inherited from Node
#==, #each_direct_children, #each_sub_nodes, #flat_string, #kind, #pretty_print_instance_variables, #project, #render
Constructor Details
#initialize(name, tags = [], description = '', parameters = [], body = []) ⇒ Item
Returns a new instance of Item.
296 297 298 299 300 301 302 303 304 305 |
# File 'lib/hiptest-publisher/nodes.rb', line 296 def initialize(name, = [], description = '', parameters = [], body = []) super() @children = { name: name, tags: , description: description, parameters: parameters, body: body } end |
Instance Attribute Details
#non_valued_parameters ⇒ Object (readonly)
Returns the value of attribute non_valued_parameters.
294 295 296 |
# File 'lib/hiptest-publisher/nodes.rb', line 294 def non_valued_parameters @non_valued_parameters end |
#valued_parameters ⇒ Object (readonly)
Returns the value of attribute valued_parameters.
294 295 296 |
# File 'lib/hiptest-publisher/nodes.rb', line 294 def valued_parameters @valued_parameters end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
294 295 296 |
# File 'lib/hiptest-publisher/nodes.rb', line 294 def variables @variables end |
Instance Method Details
#add_tags(tags) ⇒ Object
315 316 317 318 319 320 321 322 323 324 |
# File 'lib/hiptest-publisher/nodes.rb', line 315 def () existing = @children[:tags].map(&:to_s) .each do |tag| next if existing.include? tag.to_s existing << tag.to_s @children[:tags] << tag end end |
#declared_variables_names ⇒ Object
307 308 309 310 311 312 313 |
# File 'lib/hiptest-publisher/nodes.rb', line 307 def declared_variables_names p_names = children[:parameters].map {|p| p.children[:name]} each_sub_nodes(Hiptest::Nodes::Variable).map do |var| v_name = var.children[:name] p_names.include?(v_name) ? nil : v_name end.uniq.compact end |