Class: String

Inherits:
Object
  • Object
show all
Includes:
MethodMissingConversion
Defined in:
lib/rrrex/core_ext/string.rb

Instance Method Summary collapse

Methods included from MethodMissingConversion

included, #method_missing_with_regexp

Instance Method Details

#plus_with_regexp(str2) ⇒ Object Also known as: +



9
10
11
12
13
14
15
# File 'lib/rrrex/core_ext/string.rb', line 9

def plus_with_regexp( str2 )
  if str2.kind_of? Rrrex::Match
    Rrrex::StringMatch.new( self ) + str2
  else
    self.plus_without_regexp str2
  end
end

#rmatch?(&block) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/rrrex/core_ext/string.rb', line 19

def rmatch?( &block )
  pattern = Rrrex::Match.convert Rrrex::DslContext.module_exec &block
  pattern.match self
end