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

Version Path
eac_tools-0.76.1 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.76.0 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.75.2 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_ruby_utils-0.119.2 lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.75.1 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.75.0 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_ruby_utils-0.119.1 lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.74.1 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.74.0 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.73.0 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_ruby_utils-0.119.0 lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.72.0 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_ruby_utils-0.118.1 lib/eac_ruby_utils/listable/integer_list.rb
eac_ruby_utils-0.118.0 lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.70.1 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.70.0 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.69.1 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_ruby_utils-0.117.1 lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.69.0 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb
eac_tools-0.68.0 sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb