diff options
Diffstat (limited to 'lib/rss')
-rw-r--r-- | lib/rss/0.9.rb | 2 | ||||
-rw-r--r-- | lib/rss/2.0.rb | 2 | ||||
-rw-r--r-- | lib/rss/maker/base.rb | 2 | ||||
-rw-r--r-- | lib/rss/rss.rb | 12 | ||||
-rw-r--r-- | lib/rss/trackback.rb | 10 |
5 files changed, 14 insertions, 14 deletions
diff --git a/lib/rss/0.9.rb b/lib/rss/0.9.rb index b80ad193a3..797a46ca3b 100644 --- a/lib/rss/0.9.rb +++ b/lib/rss/0.9.rb @@ -309,7 +309,7 @@ module RSS @content = content end - undef :content= + remove_method :content= def content=(value) @content = value.to_i end diff --git a/lib/rss/2.0.rb b/lib/rss/2.0.rb index 5793b35938..19cb487d79 100644 --- a/lib/rss/2.0.rb +++ b/lib/rss/2.0.rb @@ -11,7 +11,7 @@ module RSS install_model(x, '?') end - undef :ttl= + remove_method :ttl= def ttl=(value) @ttl = value.to_i end diff --git a/lib/rss/maker/base.rb b/lib/rss/maker/base.rb index 9b633f4695..93f668beff 100644 --- a/lib/rss/maker/base.rb +++ b/lib/rss/maker/base.rb @@ -186,7 +186,7 @@ EOC end private - undef make_xml_stylesheets + remove_method :make_xml_stylesheets def make_xml_stylesheets XMLStyleSheets.new(self) end diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb index 9bf94986e7..c180a70b5d 100644 --- a/lib/rss/rss.rb +++ b/lib/rss/rss.rb @@ -517,7 +517,7 @@ EOC end end - def tag(indent, additional_attrs=[]) + def tag(indent, additional_attrs=[], &block) next_indent = indent + INDENT attrs = collect_attrs @@ -525,9 +525,9 @@ EOC attrs += additional_attrs start_tag = make_start_tag(indent, next_indent, attrs) - - if block_given? - content = yield(next_indent) + + if block + content = block.call(next_indent) else content = [] end @@ -794,9 +794,9 @@ EOC end private - def tag(indent, attrs) + def tag(indent, attrs, &block) rv = xmldecl + xml_stylesheet_pi - rv << super + rv << super(indent, attrs, &block) rv end diff --git a/lib/rss/trackback.rb b/lib/rss/trackback.rb index 1bcc60404d..8bc1ee5ad5 100644 --- a/lib/rss/trackback.rb +++ b/lib/rss/trackback.rb @@ -53,12 +53,12 @@ module RSS klass_name = x.capitalize klass.install_have_child_element(var_name) klass.module_eval(<<-EOC, __FILE__, __LINE__) - undef #{var_name} + remove_method :#{var_name} def #{var_name} @#{var_name} and @#{var_name}.value end - undef #{var_name}= + remove_method :#{var_name}= def #{var_name}=(value) @#{var_name} = new_with_value_if_need(#{klass_name}, value) end @@ -70,7 +70,7 @@ module RSS klass_name = name.capitalize klass.install_have_children_element(var_name) klass.module_eval(<<-EOC, __FILE__, __LINE__) - undef #{var_name} + remove_method :#{var_name} def #{var_name}(*args) if args.empty? @#{var_name}.first and @#{var_name}.first.value @@ -84,8 +84,8 @@ module RSS end end - undef #{var_name}= - undef set_#{var_name} + remove_method :#{var_name}= + remove_method :set_#{var_name} def #{var_name}=(*args) if args.size == 1 item = new_with_value_if_need(#{klass_name}, args[0]) |