Sha256: cd4869c44e468d12e4cfac011c54345188c3ec1de6a5b343d2dc9492a4de5b59

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

module Polyfill
  module V2_3
    module Enumerable
      module Instance
        module SliceBefore
          module Method
            def slice_before(*args)
              if !args.empty? && block_given?
                raise ArgumentError, 'wrong number of arguments (given 1, expected 0)'
              end

              super
            end
          end

          refine ::Array do
            include Method
          end
          refine ::Dir do
            include Method
          end
          refine ::Enumerator do
            include Method
          end
          refine ::Hash do
            include Method
          end
          refine ::IO do
            include Method
          end
          refine ::Range do
            include Method
          end
          refine ::StringIO do
            include Method
          end
          refine ::Struct do
            include Method
          end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyfill-0.6.0 lib/polyfill/v2_3/enumerable/instance/slice_before.rb