Class: Regexp
- Defined in:
- lib/active_support/core_ext/regexp.rb,
lib/active_support/core_ext/object/json.rb
Instance Method Summary collapse
-
#as_json(options = nil) ⇒ Object
:nodoc:.
-
#multiline? ⇒ Boolean
Returns
true
if the regexp has the multiline flag set.
Instance Method Details
#as_json(options = nil) ⇒ Object
:nodoc:
142 143 144 |
# File 'lib/active_support/core_ext/object/json.rb', line 142 def as_json( = nil) # :nodoc: to_s end |
#multiline? ⇒ Boolean
Returns true
if the regexp has the multiline flag set.
(/./).multiline? # => false
(/./m).multiline? # => true
Regexp.new(".").multiline? # => false
Regexp.new(".", Regexp::MULTILINE).multiline? # => true
11 12 13 |
# File 'lib/active_support/core_ext/regexp.rb', line 11 def multiline? & MULTILINE == MULTILINE end |