Class: RDoc::Markup::RegexpHandling

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc/markup/regexp_handling.rb

Overview

Hold details of a regexp handling sequence

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, text) ⇒ RegexpHandling

Creates a new regexp handling sequence of type with text



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

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

Instance Attribute Details

#textObject

Regexp handling text



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

def text
  @text
end

#typeObject (readonly)

Regexp handling type



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

def type
  @type
end

Instance Method Details

#==(o) ⇒ Object

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



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

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

#inspectObject

:nodoc:



31
32
33
34
# 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_sObject

:nodoc:



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

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