Sha256: 6e3ed2766b3a3527ce65be3a9ddc3cc02360b92e7b6aa58af25a88356d18ebcf
Contents?: true
Size: 471 Bytes
Versions: 5
Compression:
Stored size: 471 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) labels.first.to_h { |k, v| [k.to_i, v.to_s] } else labels.each_with_index.to_h { |v, i| [i + 1, v.to_s] } end end def build_value(index, _key) index + 1 end end end end
Version data entries
5 entries across 5 versions & 2 rubygems