Class: RDoc::Markup::Special

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

Overview

Hold details of a special sequence

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, text) ⇒ Special

Creates a new special sequence of type with text



19
20
21
# File 'lib/rdoc/markup/special.rb', line 19

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

Instance Attribute Details

#textObject

Special text



14
15
16
# File 'lib/rdoc/markup/special.rb', line 14

def text
  @text
end

#typeObject (readonly)

Special type



9
10
11
# File 'lib/rdoc/markup/special.rb', line 9

def type
  @type
end

Instance Method Details

#==(o) ⇒ Object

Specials are equal when the have the same text and type



26
27
28
# File 'lib/rdoc/markup/special.rb', line 26

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

#inspectObject

:nodoc:



30
31
32
33
# File 'lib/rdoc/markup/special.rb', line 30

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

#to_sObject

:nodoc:



35
36
37
# File 'lib/rdoc/markup/special.rb', line 35

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