Sha256: cffb5513da91c0d35e0c4c804e18d1f9f1d5f734f1d3a7d499683cfcaadb7e7d

Contents?: true

Size: 672 Bytes

Versions: 13

Compression:

Stored size: 672 Bytes

Contents

module Formotion
  class InvalidClassError < StandardError; end
  class InvalidSectionError < StandardError; end
  class NoRowTypeError < StandardError; end

  class Conditions
    class << self
      def assert_nil_or_boolean(obj)
        if not (obj.nil? or obj.is_a? TrueClass or obj.is_a? FalseClass)
          raise Formotion::InvalidClassError, "#{obj.inspect} should be nil, true, or false, but is #{obj.class.to_s}"
        end
      end

      def assert_class(obj, klass)
        if not obj.is_a? klass
          raise Formotion::InvalidClassError, "#{obj.inspect} of class #{obj.class.to_s} is not of class #{klass.to_s}"
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
formotion-1.8 lib/formotion/exceptions.rb
formotion-1.7 lib/formotion/exceptions.rb
formotion-1.6 lib/formotion/exceptions.rb
formotion-1.5.1 lib/formotion/exceptions.rb
formotion-1.5.0 lib/formotion/exceptions.rb
formotion-1.4.0 lib/formotion/exceptions.rb
formotion-1.3.1 lib/formotion/exceptions.rb
formotion-1.3 lib/formotion/exceptions.rb
formotion-1.2 lib/formotion/exceptions.rb
formotion-1.1.5 lib/formotion/exceptions.rb
formotion-1.1.4 lib/formotion/exceptions.rb
formotion-1.1.3 lib/formotion/exceptions.rb
formotion-1.1.2 lib/formotion/exceptions.rb