Class: Workarea::Catalog::CleanDetails
- Inherits:
-
Object
- Object
- Workarea::Catalog::CleanDetails
- Defined in:
- app/models/workarea/catalog/clean_details.rb
Instance Method Summary collapse
- #cleaned ⇒ Object
-
#initialize(dirty) ⇒ CleanDetails
constructor
A new instance of CleanDetails.
Constructor Details
#initialize(dirty) ⇒ CleanDetails
Returns a new instance of CleanDetails.
4 5 6 |
# File 'app/models/workarea/catalog/clean_details.rb', line 4 def initialize(dirty) @dirty = dirty end |
Instance Method Details
#cleaned ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'app/models/workarea/catalog/clean_details.rb', line 8 def cleaned tuples = @dirty.map do |key, value| next if key.blank? || value.blank? [key, Array.wrap(value)] end Hash[tuples.compact] end |