Class: Pennyworth::Loaders::Encoding
- Inherits:
-
Object
- Object
- Pennyworth::Loaders::Encoding
- Defined in:
- lib/pennyworth/loaders/encoding.rb
Overview
Loads an array of encoding records.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(encoding: ::Encoding, model: Models::Encoding) ⇒ Encoding
constructor
A new instance of Encoding.
Constructor Details
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/pennyworth/loaders/encoding.rb', line 16 def call(*) encoding.aliases .map { |_second, first| first } .uniq .sort .map do |first| model[name: first, aliases: encoding.find(first).names.sort.excluding(first)] end end |