Class: Archsight::Query::AST::RegexValue
- Inherits:
-
Object
- Object
- Archsight::Query::AST::RegexValue
- Defined in:
- lib/archsight/query/ast.rb
Instance Attribute Summary collapse
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Instance Method Summary collapse
-
#initialize(pattern, flags = "") ⇒ RegexValue
constructor
A new instance of RegexValue.
- #to_regexp ⇒ Object
Constructor Details
#initialize(pattern, flags = "") ⇒ RegexValue
Returns a new instance of RegexValue.
269 270 271 272 |
# File 'lib/archsight/query/ast.rb', line 269 def initialize(pattern, flags = "") @pattern = pattern @flags = flags end |
Instance Attribute Details
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
267 268 269 |
# File 'lib/archsight/query/ast.rb', line 267 def flags @flags end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
267 268 269 |
# File 'lib/archsight/query/ast.rb', line 267 def pattern @pattern end |
Instance Method Details
#to_regexp ⇒ Object
274 275 276 277 |
# File 'lib/archsight/query/ast.rb', line 274 def to_regexp = @flags.include?("i") ? Regexp::IGNORECASE : 0 Regexp.new(@pattern, ) end |