Class: Dictionary
Instance Method Summary collapse
-
#order_by_key ⇒ Object
Works as the method with the same name in facets but works around a bug with facets and ruby 1.9.
-
#order_by_value ⇒ Object
Works as the method with the same name in facets but works around a bug with facets and ruby 1.9.
-
#reverse_each { ... } ⇒ Dictionary
Calls the block passing it each key and the corresponding value starting from the last.
Instance Method Details
#order_by_key ⇒ Object
Works as the method with the same name in facets but works around a bug with facets and ruby 1.9
279 280 281 282 283 |
# File 'lib/ruber/utils.rb', line 279 def order_by_key @order_by = lambda { |i| i[0] } order self end |
#order_by_value ⇒ Object
Works as the method with the same name in facets but works around a bug with facets and ruby 1.9
268 269 270 271 272 |
# File 'lib/ruber/utils.rb', line 268 def order_by_value @order_by = lambda { |i| i[0] } order self end |
#reverse_each { ... } ⇒ Dictionary
Calls the block passing it each key and the corresponding value starting from the last
293 294 295 296 |
# File 'lib/ruber/utils.rb', line 293 def reverse_each order.reverse_each{|k| yield k, @hash[k] } self end |