Class: Ruboclean::Orderer
- Inherits:
-
Object
- Object
- Ruboclean::Orderer
- Defined in:
- lib/ruboclean/orderer.rb
Overview
Orders the items within the groups alphabetically
Instance Method Summary collapse
-
#initialize(configuration_hash) ⇒ Orderer
constructor
A new instance of Orderer.
- #order ⇒ Object
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
#order ⇒ Object
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 |