class Hiptest::Nodes::Item

Attributes

non_valued_parameters[R]
valued_parameters[R]
variables[R]

Public Class Methods

new(name, tags = [], description = '', parameters = [], body = []) click to toggle source
Calls superclass method
# File lib/hiptest-publisher/nodes.rb, line 296
def initialize(name, tags = [], description = '', parameters = [], body = [])
  super()
  @children = {
    name: name,
    tags: tags,
    description: description,
    parameters: parameters,
    body: body
  }
end

Public Instance Methods

add_tags(tags) click to toggle source
# File lib/hiptest-publisher/nodes.rb, line 315
def add_tags(tags)
  existing = @children[:tags].map(&:to_s)

  tags.each do |tag|
    next if existing.include? tag.to_s

    existing << tag.to_s
    @children[:tags] << tag
  end
end
declared_variables_names() click to toggle source
# 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