Skip to content
Extends some ruby core classes
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
doc
lib
test
.gitignore
README.rdoc
ruby_extensions.gemspec

README.rdoc

Install

sudo gem install ruby_extend

Quality Metrics

Release 1

Extend Hash with to_sorted_array : Recursively sorted array from hash

hash = {'user' => {'adress' => {'town' => 'Paris', 'street' => "rue de Quimper"}, 'name' => 'toto', 'age' => 12}}
hash.to_sorted_array
 # => [["user", [["adress", [["street", "rue de Quimper"], ["town", "Paris"]]], ["age", 12], ["name", "toto"]]]

Extend Array with #to_hash : Recursively convert array to hash

array = [["user", [["adress", [["street", "rue de Quimper"], ["town", "Paris"]]], ["age", 12], ["name", "toto"]]]]
array.to_hash
# =>{"user"=>  {"name"=>"toto", "adress"=>{"street"=>"rue de Quimper", "town"=>"Paris"}, "age"=>12}}

Release 2

Array#move(from,to)

Array#included_in?(array)

Array#duplicates

Array#map_with_index

Array#average

Array#longest
Something went wrong with that request. Please try again.