123456789_123456789_123456789_123456789_123456789_

Class: RDoc::Markup::RegexpHandling

Relationships & Source Files
Inherits: Object
Defined in: lib/rdoc/markup/regexp_handling.rb

Overview

Hold details of a regexp handling sequence

Class Method Summary

Instance Attribute Summary

  • #text rw

    Regexp handling text.

  • #type readonly

    Regexp handling type.

Instance Method Summary

  • #==(o)

    Regexp handlings are equal when the have the same text and type.

  • #inspect Internal use only
  • #to_s Internal use only

Constructor Details

.new(type, text) ⇒ RegexpHandling

Creates a new regexp handling sequence of #type with #text

[ GitHub ]

  
# File 'lib/rdoc/markup/regexp_handling.rb', line 20

def initialize(type, text)
  @type, @text = type, text
end

Instance Attribute Details

#text (rw)

Regexp handling text

[ GitHub ]

  
# File 'lib/rdoc/markup/regexp_handling.rb', line 15

attr_accessor :text

#type (readonly)

Regexp handling type

[ GitHub ]

  
# File 'lib/rdoc/markup/regexp_handling.rb', line 10

attr_reader   :type

Instance Method Details

#==(o)

Regexp handlings are equal when the have the same text and type

[ GitHub ]

  
# File 'lib/rdoc/markup/regexp_handling.rb', line 27

def ==(o)
  self.text == o.text && self.type == o.type
end

#inspect

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rdoc/markup/regexp_handling.rb', line 31

def inspect # :nodoc:
  "#<RDoc::Markup::RegexpHandling:0x%x @type=%p, @text=%p>" % [
    object_id, @type, text.dump]
end

#to_s

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rdoc/markup/regexp_handling.rb', line 36

def to_s # :nodoc:
  "RegexpHandling: type=#{type} text=#{text.dump}"
end