Sha256: 7afebc0157ae1e9cbe966b9cf09bd3d14bda6f715ae92ce555f89864cf8c310c

Contents?: true

Size: 544 Bytes

Versions: 12

Compression:

Stored size: 544 Bytes

Contents

# typed: strict

module PackStats
  module Tags
    extend T::Sig

    sig { params(colon_delimited_tag_strings: T::Array[String]).returns(T::Array[Tag]) }
    def self.for(colon_delimited_tag_strings)
      colon_delimited_tag_strings.map do |colon_delimited_tag_string|
        key, value = colon_delimited_tag_string.split(':')
        raise StandardError, "Improperly formatted tag `#{colon_delimited_tag_string}`" if key.nil? || value.nil?

        Tag.new(
          key: key,
          value: value
        )
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pack_stats-0.2.1 lib/pack_stats/tags.rb
pack_stats-0.2.0 lib/pack_stats/tags.rb
pack_stats-0.1.3 lib/pack_stats/tags.rb
pack_stats-0.1.2 lib/pack_stats/tags.rb
pack_stats-0.1.1 lib/pack_stats/tags.rb
pack_stats-0.1.0 lib/pack_stats/tags.rb
pack_stats-0.0.6 lib/pack_stats/tags.rb
pack_stats-0.0.5 lib/pack_stats/tags.rb
pack_stats-0.0.4 lib/pack_stats/tags.rb
pack_stats-0.0.3 lib/pack_stats/tags.rb
pack_stats-0.0.2 lib/pack_stats/tags.rb
pack_stats-0.0.1 lib/pack_stats/tags.rb