Sha256: f5cdd88b656886ec32a54a7a763c5ad48e95c96c113a522fa3a4a03ea3444216

Contents?: true

Size: 559 Bytes

Versions: 1

Compression:

Stored size: 559 Bytes

Contents

module Polyfill
  module V2_4
    module MatchData
      module Instance
        module ValuesAt
          module Method
            def values_at(*indexes)
              indexes.each_with_object([]) do |index, acc|
                acc.push(self[index])
              end
            end
          end

          if RUBY_VERSION < '2.4.0'
            refine ::MatchData do
              include Method
            end

            def self.included(base)
              base.include Method
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyfill-0.3.0 lib/polyfill/v2_4/match_data/instance/values_at.rb