Sha256: 6d2b558ab8c1c6de51d7878830323a6ba416819929e77d858f43eb5be50c31d4

Contents?: true

Size: 380 Bytes

Versions: 7

Compression:

Stored size: 380 Bytes

Contents

module Elasticity

  module ConditionalRaising

    def raise_if(conditional, error_class, message)
      raise error_class, message if conditional
    end

    def raise_unless(conditional, error_class, message)
      raise error_class, message unless conditional
    end

  end

end

module Kernel
  include Elasticity::ConditionalRaising
end

class Object
  include Kernel
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
elasticity-2.4 lib/elasticity/support/conditional_raise.rb
elasticity-2.3.1 lib/elasticity/support/conditional_raise.rb
elasticity-2.3 lib/elasticity/support/conditional_raise.rb
elasticity-2.2 lib/elasticity/support/conditional_raise.rb
elasticity-2.1.1 lib/elasticity/support/conditional_raise.rb
elasticity-2.1 lib/elasticity/support/conditional_raise.rb
elasticity-2.0 lib/elasticity/support/conditional_raise.rb