Class: LEON::RegExp

Inherits:
Object show all
Defined in:
lib/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ RegExp

Returns a new instance of RegExp.



9
10
11
12
13
14
15
16
# File 'lib/types.rb', line 9

def initialize(*args)
  if args.length > 1
    @modifier = args[1]
  else
    @modifier = ''
  end
  @pattern = args[0]
end

Instance Attribute Details

#modifierObject

Returns the value of attribute modifier.



8
9
10
# File 'lib/types.rb', line 8

def modifier
  @modifier
end

#patternObject

Returns the value of attribute pattern.



7
8
9
# File 'lib/types.rb', line 7

def pattern
  @pattern
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/types.rb', line 17

def to_s()
  return '/' + @pattern + '/' + @modifier
end