Sha256: a4516849d486bcb3db384e7d7261b3b076f281c1ab4507ac1b0869a8c052d38f
Contents?: true
Size: 987 Bytes
Versions: 2
Compression:
Stored size: 987 Bytes
Contents
# RangeBuilder Builds ranges from an enumeration ## Installation Add this line to your application's Gemfile: gem 'range_builder' And then execute: $ bundle Or install it yourself as: $ gem install range_builder ## Usage persons = [15, 60, 15, 61, 59, 19].map{|age| Person.new(age: age) } RangeBuilder.build_range( persons ){|person| person.age } # returns range from mininal to maximal data: # ( <Person aged 15> .. <Person aged 61> ) sorted_array = [ 2, 3, 4, 6, 7, 9, 11, 12, 13] # sorted_array must be sorted and elements must implement successor: #succ RangeBuilder.build_from_sorted(sorted_array) # returns array of ranges: # [ (2..4), (6..7), (9..9), (11..13) ] ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
range_builder-1.0.1 | README.md |
range_builder-1.0.0 | README.md |