Class HtmlEncode::RegexpHashUnion
In: lib/html_encode.rb
Parent: Object

Methods

=~   gsub!   new  

Attributes

regexp  [R] 

Public Class methods

[Source]

# File lib/html_encode.rb, line 11
    def initialize ( aHash )
      @hash = aHash
      @regexp = Regexp.compile(@hash.keys.map { |re| re.source }.join('|'))
    end

Public Instance methods

[Source]

# File lib/html_encode.rb, line 21
    def =~ ( arg )
      @regexp =~ arg
    end

[Source]

# File lib/html_encode.rb, line 16
    def gsub! ( anObject )
      @hash.each { |re, str| anObject.gsub!(re, str) }
      self
    end

[Validate]