On Thu, Jul 14, 2011 at 2:47 PM, Alexey Muranov
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:
> I noticed that ActiveSupport::OrderedHash disappeared from the Rails API
> pages.
> Does it mean that it is going to be deprecated?
>
> I know that Hash is ordered in Ruby 1.9, but this subject seems
> controversial, and in my opinion the ordered hash in Ruby 1.9 should
> have been called OrderedHash (or SequentialHash), even if it be an alias
> of the current implementation of Hash.
> That way one would be free to return to unordered hashes in future
> versions of Ruby.
>
>
In Ruby 1.9, the Hash just maintains insertion order within the hash and
not content ordering (i.e. key and values). Next, OrderedHash acts very
similar in nature to Hash in Ruby 1.9.2 and OrderedHash was being
used for backwards compatibility with Ruby 1.8.7.
> I am considering using the ordered hash to store an ordered attribute
> list with their types, to be able to render their values in a table in
> the selected order.
> (This is going to be a constant hash.)
> I would like to write explicitly in my code that i am using OrderedHash.
> So, is Rails going to continue implementing ActiveSupport::OrderedHash?
>
>
If you''re using Ruby 1.9.2, it doesn''t matter if
you''re using Hash or
ActiveSupport::OrderedHash because both will yield the same result.
Furthermore,
if you declare this as a constant, then you''re saying to the users of
the
code
that this will not be modified.
Good luck,
-Conrad
Thanks for any information,>
> Alexey.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.