Sha256: af34b937f44150a9e6de8b4a8d637e8e816ee80ba67ea2adfb135bf9a16c1682

Contents?: true

Size: 495 Bytes

Versions: 3

Compression:

Stored size: 495 Bytes

Contents

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

          refine ::MatchData do
            include Method
          end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
polyfill-0.6.0 lib/polyfill/v2_4/match_data/instance/named_captures.rb
polyfill-0.5.0 lib/polyfill/v2_4/match_data/instance/named_captures.rb
polyfill-0.4.0 lib/polyfill/v2_4/match_data/instance/named_captures.rb