Class: Regexp::Expression::Root

Inherits:
Subexpression show all
Defined in:
lib/regexp_parser/expression/classes/root.rb

Instance Attribute Summary

Attributes inherited from Subexpression

#expressions

Attributes inherited from Base

#level, #options, #quantifier, #text, #token, #ts, #type

Instance Method Summary collapse

Methods inherited from Subexpression

#<<, #[], #clone, #each, #each_with_index, #first, #insert, #last, #length, #to_s

Methods inherited from Base

#clone, #coded_offset, #full_length, #greedy?, #offset, #possessive?, #quantified?, #quantify, #quantity, #reluctant?, #starts_at, #terminal?, #to_re, #to_s

Constructor Details

#initializeRoot

Returns a new instance of Root.



4
5
6
# File 'lib/regexp_parser/expression/classes/root.rb', line 4

def initialize
  super Regexp::Token.new(:expression, :root, '', 0)
end

Instance Method Details

#case_insensitive?Boolean Also known as: i?, ignore_case?

Returns:

  • (Boolean)


13
14
15
# File 'lib/regexp_parser/expression/classes/root.rb', line 13

def case_insensitive?
  @expressions[0].i?
end

#free_spacing?Boolean Also known as: x?, extended?

Returns:

  • (Boolean)


19
20
21
# File 'lib/regexp_parser/expression/classes/root.rb', line 19

def free_spacing?
  @expressions[0].x?
end

#multiline?Boolean Also known as: m?

Returns:

  • (Boolean)


8
9
10
# File 'lib/regexp_parser/expression/classes/root.rb', line 8

def multiline?
  @expressions[0].m?
end