summaryrefslogtreecommitdiff
path: root/lib/rss/2.0.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-16 04:39:58 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-16 04:39:58 +0000
commit0ebac90b0ebb07ad2aa99080c8509559a7ddc74d (patch)
tree4e0e2233ffd5cc0a5e1052471c41d5f3d3172d6e /lib/rss/2.0.rb
parent64422ae4941480634fbc2788d73ec3ba44c70b4b (diff)
downloadruby-0ebac90b0ebb07ad2aa99080c8509559a7ddc74d.tar.gz
* lib/rss: supported prety print.
* test/rss/test_1.0.rb: added test for calculating default indent size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/2.0.rb')
-rw-r--r--lib/rss/2.0.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/rss/2.0.rb b/lib/rss/2.0.rb
index c6c6db58a7..c4d055e984 100644
--- a/lib/rss/2.0.rb
+++ b/lib/rss/2.0.rb
@@ -23,11 +23,11 @@ module RSS
install_model(x, occurs)
end
- def other_element(convert, indent='')
+ def other_element(convert, indent)
rv = <<-EOT
-#{indent}#{category_element(convert)}
-#{indent}#{generator_element(convert)}
-#{indent}#{ttl_element(convert)}
+#{category_element(convert, indent)}
+#{generator_element(convert, indent)}
+#{ttl_element(convert, indent)}
EOT
rv << super
end
@@ -73,12 +73,12 @@ EOT
install_model(x, occurs)
end
- def other_element(convert, indent='')
+ def other_element(convert, indent)
rv = <<-EOT
-#{indent}#{author_element(false)}
-#{indent}#{comments_element(false)}
-#{indent}#{pubDate_element(false)}
-#{indent}#{guid_element(false)}
+#{author_element(false, indent)}
+#{comments_element(false, indent)}
+#{pubDate_element(false, indent)}
+#{guid_element(false, indent)}
EOT
rv << super
end
@@ -116,7 +116,7 @@ EOT
@content = content
end
- def to_s(convert=true)
+ def to_s(convert=true, indent=calc_indent)
if @content
rv = %Q!<guid!
rv << %Q! isPermaLink="#{h @isPermaLink}"! if @isPermaLink