Class: RDoc::Markup::Special

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc/markup/inline.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



121
122
123
# File 'lib/rdoc/markup/inline.rb', line 121

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

Instance Attribute Details

#textObject

Special text



116
117
118
# File 'lib/rdoc/markup/inline.rb', line 116

def text
  @text
end

#typeObject (readonly)

Special type



111
112
113
# File 'lib/rdoc/markup/inline.rb', line 111

def type
  @type
end

Instance Method Details

#==(o) ⇒ Object

Specials are equal when the have the same text and type



128
129
130
# File 'lib/rdoc/markup/inline.rb', line 128

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

#inspectObject

:nodoc:



132
133
134
135
# File 'lib/rdoc/markup/inline.rb', line 132

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

#to_sObject

:nodoc:



137
138
139
# File 'lib/rdoc/markup/inline.rb', line 137

def to_s # :nodoc:
  "Special: type=#{type}, name=#{RDoc::Markup::Attribute.as_string type}, text=#{text.dump}"
end