Project

General

Profile

Actions

Bug #8301

closed

REXML::Attributes#to_a

Added by ohai (Ippei Obayashi) about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-04-20 trunk 40391) [x86_64-linux]
[ruby-dev:47277]

Description

添付したコード(attributs_to_a.rb)を実行すると、REXML::Attributes#to_a という名前から期待される結果は
[foo:att='1', bar:att='2', att='<', baz='4']
だと思うのですが、実際には
[{"foo"=>foo:att='1', "bar"=>bar:att='2', ""=>att='<'}, baz='4']
という結果になります。これは意図した結果ではないと思うのですがどうでしょうか。

添付したパッチで上の「期待される結果」になります。


Files

attributes_to_a.rb (263 Bytes) attributes_to_a.rb ohai (Ippei Obayashi), 04/20/2013 04:39 PM
attributes_to_a.patch (340 Bytes) attributes_to_a.patch ohai (Ippei Obayashi), 04/20/2013 04:39 PM

Updated by hsbt (Hiroshi SHIBATA) about 11 years ago

  • Assignee set to kou (Kouhei Sutou)
Actions #2

Updated by kou (Kouhei Sutou) almost 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40482.
Ippei, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/rexml/element.rb (REXML::Attributes#to_a): Support
    namespaced attributes. [ruby-dev:47277] [Bug #8301]
    Patch by Ippei Obayashi. Thanks!!!
  • test/rexml/test_attributes.rb
    (AttributesTester#test_to_a_with_namespaces): Add a test of the
    above change.

Updated by kou (Kouhei Sutou) almost 11 years ago

テストを追加して取り込みました!

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0