Class: Inspec::Profile::AstHelper::TagCollector

Inherits:
CollectorBase show all
Defined in:
lib/inspec/utils/profile_ast_helpers.rb

Constant Summary collapse

ACCPETABLE_TAG_TYPE_TO_VALUES =
{
  false: false,
  true: true,
  nil: nil,
}.freeze

Instance Attribute Summary

Attributes inherited from CollectorBase

#memo

Instance Method Summary collapse

Methods inherited from CollectorBase

#initialize

Constructor Details

This class inherits a constructor from Inspec::Profile::AstHelper::CollectorBase

Instance Method Details

#on_send(node) ⇒ Object



127
128
129
130
131
132
133
134
135
# File 'lib/inspec/utils/profile_ast_helpers.rb', line 127

def on_send(node)
  if RuboCop::AST::NodePattern.new("(send nil? :tag ...)").match(node)
    memo[:tags] ||= {}

    node.children[2..-1].each do |tag_node|
      collect_tags(tag_node)
    end
  end
end