Sha256: 3140141f4920d6f812aa653befa4d19092f8c19fb69ec63c0670df6f3b747140

Contents?: true

Size: 337 Bytes

Versions: 15

Compression:

Stored size: 337 Bytes

Contents

module Polyfill
  module V2_4
    module MatchData
      def named_captures
        names.each_with_object({}) do |name, acc|
          acc[name] = self[name]
        end
      end

      def values_at(*indexes)
        indexes.each_with_object([]) do |index, acc|
          acc.push(self[index])
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
polyfill-1.9.0 lib/polyfill/v2_4/match_data.rb
polyfill-1.8.0 lib/polyfill/v2_4/match_data.rb
polyfill-1.7.0 lib/polyfill/v2_4/match_data.rb
polyfill-1.6.0 lib/polyfill/v2_4/match_data.rb
polyfill-1.5.0 lib/polyfill/v2_4/match_data.rb
polyfill-1.4.0 lib/polyfill/v2_4/match_data.rb
polyfill-1.3.0 lib/polyfill/v2_4/match_data.rb
polyfill-1.2.0 lib/polyfill/v2_4/match_data.rb
polyfill-1.1.0 lib/polyfill/v2_4/match_data.rb
polyfill-1.0.1 lib/polyfill/v2_4/match_data.rb
polyfill-1.0.0 lib/polyfill/v2_4/match_data.rb
polyfill-0.10.0 lib/polyfill/v2_4/match_data.rb
polyfill-0.9.0 lib/polyfill/v2_4/match_data.rb
polyfill-0.8.0 lib/polyfill/v2_4/match_data.rb
polyfill-0.7.0 lib/polyfill/v2_4/match_data.rb