Class: LEON::RegExp
Instance Attribute Summary collapse
-
#modifier ⇒ Object
Returns the value of attribute modifier.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Instance Method Summary collapse
-
#initialize(*args) ⇒ RegExp
constructor
A new instance of RegExp.
- #to_s ⇒ Object
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
#modifier ⇒ Object
Returns the value of attribute modifier.
8 9 10 |
# File 'lib/types.rb', line 8 def modifier @modifier end |
#pattern ⇒ Object
Returns the value of attribute pattern.
7 8 9 |
# File 'lib/types.rb', line 7 def pattern @pattern end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/types.rb', line 17 def to_s() return '/' + @pattern + '/' + @modifier end |