Sha256: 2192d9b1846c90cea2fbd4dd74c4e5f20adca0d93c355897c0a2b879b1b80713
Contents?: true
Size: 481 Bytes
Versions: 403
Compression:
Stored size: 481 Bytes
Contents
# frozen_string_literal: true require_relative 'list' module EacRubyUtils module Listable class IntegerList < ::EacRubyUtils::Listable::List protected def parse_labels(labels) if labels.first.is_a?(Hash) Hash[labels.first.map { |k, v| [k.to_i, v.to_s] }] else Hash[labels.each_with_index.map { |v, i| [i + 1, v.to_s] }] end end def build_value(index, _key) index + 1 end end end end
Version data entries
403 entries across 403 versions & 4 rubygems