Sha256: 6057c48c31f2a112b9df85f596b5bb772b83a933c346a768faad17599947637d
Contents?: true
Size: 681 Bytes
Versions: 17
Compression:
Stored size: 681 Bytes
Contents
# frozen_string_literal: true require "refinements/array" module Pennyworth module Loaders # Loads an array of encoding records. class Encoding using Refinements::Array def initialize encoding: ::Encoding, model: Models::Encoding @encoding = encoding @model = model end 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 private attr_reader :encoding, :model end end end
Version data entries
17 entries across 17 versions & 1 rubygems