Class: ColorSort::Sorter
- Inherits:
-
Object
- Object
- ColorSort::Sorter
- Defined in:
- lib/color_sort/sorter.rb
Instance Method Summary collapse
-
#initialize(colors) ⇒ Sorter
constructor
A new instance of Sorter.
- #sorted ⇒ Object
Constructor Details
#initialize(colors) ⇒ Sorter
Returns a new instance of Sorter.
3 4 5 |
# File 'lib/color_sort/sorter.rb', line 3 def initialize(colors) @colors = colors end |
Instance Method Details
#sorted ⇒ Object
7 8 9 10 11 |
# File 'lib/color_sort/sorter.rb', line 7 def sorted ordering.colors.map { |lab_color| color_map[lab_color] } end |