Methods

Class Index

Quicksearch

Arrow::RegexpOperators

Add some operator methods to regular expression objects for catenation, union, etc.

Public Instance Methods

+( other ) click to toggle source

Append the given other Regexp (or String) onto a copy of the receiving one and return it.

    # File /Users/ged/source/ruby/Arrow/lib/arrow/monkeypatches.rb, line 30
30:     def +( other ) 
31:         return self.class.new( self.to_s + other.to_s )
32:     end
|( other ) click to toggle source

Create and return a new Regexp that is an alternation between the receiver and the other Regexp.

    # File /Users/ged/source/ruby/Arrow/lib/arrow/monkeypatches.rb, line 36
36:     def |( other )
37:         return Regexp.new( "(?:%s|%s)" % [self.to_s, other.to_s] )
38:     end

secsequence

--- SEC00086

seccomment

--- ""

method_list

--- 
- methods: 
  - visibility: public
    aref: M000140
    name: +
    sourcecode: "    <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/monkeypatches.rb, line 30</span>\n\
      30:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-operator\">+</span>( <span class=\"ruby-identifier\">other</span> ) \n\
      31:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">to_s</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-identifier\">other</span>.<span class=\"ruby-identifier\">to_s</span> )\n\
      32:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Append the given <tt>other</tt> Regexp (or String) onto a copy of the
      receiving one and return it.
      </p>
    params: ( other )
  - visibility: public
    aref: M000141
    name: "|"
    sourcecode: "    <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/monkeypatches.rb, line 36</span>\n\
      36:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-operator\">|</span>( <span class=\"ruby-identifier\">other</span> )\n\
      37:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-constant\">Regexp</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-value str\">&quot;(?:%s|%s)&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">to_s</span>, <span class=\"ruby-identifier\">other</span>.<span class=\"ruby-identifier\">to_s</span>] )\n\
      38:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Create and return a new Regexp that is an alternation between the receiver
      and the <tt>other</tt> Regexp.
      </p>
    params: ( other )
  category: Instance
  type: Public

sectitle

--- 

[Validate]

Generated with the Darkfish Rdoc Generator.