Sha256: 1ba5bcd568e6025c26be11dbcfd8cca18b6b2caf8c3834c55f0240cd96245b69

Contents?: true

Size: 577 Bytes

Versions: 13

Compression:

Stored size: 577 Bytes

Contents

module Fiona7
  class Assert
    class << self
      def constraint(condition, message, code=418)
        raise Scrivito::ClientError.new(message, http_code: code) unless condition
      end

      def input(condition, message, code=422)
        raise Scrivito::ClientError.new(message, http_code: code) unless condition
      end

      def success(condition, message)
        raise Scrivito::ScrivitoError, message unless condition
      end

      def exists(condition, message)
        raise Scrivito::ResourceNotFound, message unless condition
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.5 lib/fiona7/assert.rb
infopark_fiona7-1.6.1.1.1 lib/fiona7/assert.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/assert.rb
infopark_fiona7-1.5.5.5.1 lib/fiona7/assert.rb
infopark_fiona7-1.5.5.5.0 lib/fiona7/assert.rb
infopark_fiona7-1.5.5.4.1 lib/fiona7/assert.rb
infopark_fiona7-1.5.5.4.0 lib/fiona7/assert.rb
infopark_fiona7-1.5.5.3.1 lib/fiona7/assert.rb
infopark_fiona7-1.5.4.3.0 lib/fiona7/assert.rb
infopark_fiona7-1.5.3.2.0 lib/fiona7/assert.rb
infopark_fiona7-1.5.3.2.0.pre.beta1 lib/fiona7/assert.rb
infopark_fiona7-1.5.2.1.0.pre.beta1 lib/fiona7/assert.rb
infopark_fiona7-1.5.2.0.0 lib/fiona7/assert.rb