summaryrefslogtreecommitdiff
path: root/ruby_1_9_3/lib/rdoc/markup/heading.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ruby_1_9_3/lib/rdoc/markup/heading.rb')
-rw-r--r--ruby_1_9_3/lib/rdoc/markup/heading.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/ruby_1_9_3/lib/rdoc/markup/heading.rb b/ruby_1_9_3/lib/rdoc/markup/heading.rb
new file mode 100644
index 0000000000..3bda77a1e1
--- /dev/null
+++ b/ruby_1_9_3/lib/rdoc/markup/heading.rb
@@ -0,0 +1,20 @@
+##
+# A heading with a level (1-6) and text
+
+class RDoc::Markup::Heading < Struct.new :level, :text
+
+ ##
+ # Calls #accept_heading on +visitor+
+
+ def accept visitor
+ visitor.accept_heading self
+ end
+
+ def pretty_print q # :nodoc:
+ q.group 2, "[head: #{level} ", ']' do
+ q.pp text
+ end
+ end
+
+end
+