1##
2# Hold details of a special sequence
3
4class RDoc::Markup::Special
5
6  ##
7  # Special type
8
9  attr_reader   :type
10
11  ##
12  # Special text
13
14  attr_accessor :text
15
16  ##
17  # Creates a new special sequence of +type+ with +text+
18
19  def initialize(type, text)
20    @type, @text = type, text
21  end
22
23  ##
24  # Specials are equal when the have the same text and type
25
26  def ==(o)
27    self.text == o.text && self.type == o.type
28  end
29
30  def inspect # :nodoc:
31    "#<RDoc::Markup::Special:0x%x @type=%p, @text=%p>" % [
32      object_id, @type, text.dump]
33  end
34
35  def to_s # :nodoc:
36    "Special: type=#{type} text=#{text.dump}"
37  end
38
39end
40
41