Skip to content

Commit

Permalink
Merge pull request #40604 from jonathanhefner/activesupport-regexp-mu…
Browse files Browse the repository at this point in the history
…ltiline-docs

Document Regexp#multiline? [ci-skip]
  • Loading branch information
rafaelfranca committed Nov 12, 2020
1 parent fad36a8 commit cbe32e3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion activesupport/lib/active_support/core_ext/regexp.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# frozen_string_literal: true

class Regexp #:nodoc:
class Regexp
# 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
def multiline?
options & MULTILINE == MULTILINE
end
Expand Down

0 comments on commit cbe32e3

Please sign in to comment.