Class: Archsight::Query::AST::NameCondition

Inherits:
Node
  • Object
show all
Defined in:
lib/archsight/query/ast.rb

Overview

Name condition: name == “value” or name =~ “pattern”

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operator, value) ⇒ NameCondition

Returns a new instance of NameCondition.



127
128
129
130
# File 'lib/archsight/query/ast.rb', line 127

def initialize(operator, value)
  @operator = operator # String (==, !=, =~)
  @value = value       # StringValue or RegexValue
end

Instance Attribute Details

#operatorObject (readonly)

Returns the value of attribute operator.



125
126
127
# File 'lib/archsight/query/ast.rb', line 125

def operator
  @operator
end

#valueObject (readonly)

Returns the value of attribute value.



125
126
127
# File 'lib/archsight/query/ast.rb', line 125

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



132
133
134
# File 'lib/archsight/query/ast.rb', line 132

def accept(visitor)
  visitor.visit_name_condition(self)
end