Class: Ruboclean::Orderer

Inherits:
Object
  • Object
show all
Defined in:
lib/ruboclean/orderer.rb

Overview

Orders the items within the groups alphabetically

Instance Method Summary collapse

Constructor Details

#initialize(configuration_hash) ⇒ Orderer

Returns a new instance of Orderer.



6
7
8
# File 'lib/ruboclean/orderer.rb', line 6

def initialize(configuration_hash)
  @configuration_hash = configuration_hash
end

Instance Method Details

#orderObject



10
11
12
13
14
15
# File 'lib/ruboclean/orderer.rb', line 10

def order
  grouped_config.reduce({}) do |result, group|
    _group_name, group_items = group
    result.merge!(order_by_key(group_items))
  end
end