Sha256: 56ab688e8676a3fe3c390823464cf2dc738b68743a0ecd56c6a66b9fdedc71ad

Contents?: true

Size: 403 Bytes

Versions: 25

Compression:

Stored size: 403 Bytes

Contents

module RubyVersionHelpers
  RUBY_2_4 = Gem::Version.new('2.4.0')
  CURRENT_RUBY = Gem::Version.new(RUBY_VERSION)

  def numeric_type
    if CURRENT_RUBY < RUBY_2_4
      Fixnum
    else
      Integer
    end
  end
  module_function :numeric_type

  def a_numeric
    type = numeric_type
    if type == Integer
      "an #{type}"
    else
      "a #{type}"
    end
  end
  module_function :a_numeric
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pact-support-1.11.0 spec/support/ruby_version_helpers.rb
pact-support-1.10.3 spec/support/ruby_version_helpers.rb
pact-support-1.10.2 spec/support/ruby_version_helpers.rb
pact-support-1.10.1 spec/support/ruby_version_helpers.rb
pact-support-1.10.0 spec/support/ruby_version_helpers.rb
pact-support-1.9.0 spec/support/ruby_version_helpers.rb
pact-support-1.8.1 spec/support/ruby_version_helpers.rb
pact-support-1.8.0 spec/support/ruby_version_helpers.rb
pact-support-1.7.2 spec/support/ruby_version_helpers.rb
pact-support-1.7.1 spec/support/ruby_version_helpers.rb
pact-support-1.7.0 spec/support/ruby_version_helpers.rb
pact-support-1.6.6 spec/support/ruby_version_helpers.rb
pact-support-1.6.5 spec/support/ruby_version_helpers.rb
pact-support-1.7.0.alpha.1 spec/support/ruby_version_helpers.rb
pact-support-1.6.4 spec/support/ruby_version_helpers.rb
pact-support-1.6.3 spec/support/ruby_version_helpers.rb
pact-support-1.6.2 spec/support/ruby_version_helpers.rb
pact-support-1.6.1 spec/support/ruby_version_helpers.rb
pact-support-1.6.0 spec/support/ruby_version_helpers.rb
pact-support-1.5.2 spec/support/ruby_version_helpers.rb