Sha256: d3cfd131aef9a75ba1a39ead661699bc3cceac2aa6384fc560843372ea42b3fe

Contents?: true

Size: 449 Bytes

Versions: 1

Compression:

Stored size: 449 Bytes

Contents

# frozen_string_literal: true

require 'enumerator'
require 'generator' if RUBY_VERSION < '1.9'

module Combinatorics
  # auto-detects the `Generator` class.
  Generator = if defined?(::Generator) # 1.8.7
                ::Generator
              elsif defined?(::Enumerator::Generator) # >= 1.9.1
                ::Enumerator::Generator
              else
                raise(NameError,"unable to find the Generator class")
              end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
combinatorics-0.5.0 lib/combinatorics/generator.rb