Class: Hiptest::Nodes::Item

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

Direct Known Subclasses

Actionword, Scenario

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #parent

Instance Method Summary collapse

Methods inherited from Node

#==, #each_direct_children, #each_sub_nodes, #kind, #pretty_print_instance_variables, #project, #render

Constructor Details

#initialize(name, tags = [], parameters = [], body = []) ⇒ Item

Returns a new instance of Item.



240
241
242
243
244
245
246
247
248
# File 'lib/hiptest-publisher/nodes.rb', line 240

def initialize(name, tags = [], parameters = [], body = [])
  super()
  @children = {
    :name => name,
    :tags => tags,
    :parameters => parameters,
    :body => body
  }
end

Instance Attribute Details

#non_valued_parametersObject (readonly)

Returns the value of attribute non_valued_parameters.



238
239
240
# File 'lib/hiptest-publisher/nodes.rb', line 238

def non_valued_parameters
  @non_valued_parameters
end

#valued_parametersObject (readonly)

Returns the value of attribute valued_parameters.



238
239
240
# File 'lib/hiptest-publisher/nodes.rb', line 238

def valued_parameters
  @valued_parameters
end

#variablesObject (readonly)

Returns the value of attribute variables.



238
239
240
# File 'lib/hiptest-publisher/nodes.rb', line 238

def variables
  @variables
end

Instance Method Details

#declared_variables_namesObject



250
251
252
253
254
255
256
# File 'lib/hiptest-publisher/nodes.rb', line 250

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