Sha256: 36cb351b843da2236a80cf544471b45a4ba6d2014361a1565bb71c2bdb588b39

Contents?: true

Size: 247 Bytes

Versions: 5

Compression:

Stored size: 247 Bytes

Contents

module CoreExtensions
  # adds an integer? method to any object when used in a class
  module Integerable
    refine Object do
      def integer?
        Integer(self)
      rescue
        false
      else
        true
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
finapps-2.0.6 lib/finapps/core_extensions/integerable.rb
finapps-2.0.5 lib/finapps/core_extensions/integerable.rb
finapps-2.0.4 lib/finapps/core_extensions/integerable.rb
finapps-2.0.3 lib/finapps/core_extensions/integerable.rb
finapps-2.0.2 lib/finapps/core_extensions/integerable.rb