Sha256: 66d215296c3ff66964455bb1e4ec3f4f5ae6418894fd6422110fd03cb527a6c2

Contents?: true

Size: 336 Bytes

Versions: 5

Compression:

Stored size: 336 Bytes

Contents

module Monolens
  module Type
    class Boolean
      include Type::ErrorHandling

      def self.dress(instance, registry, &block)
        fail!("Invalid Boolean `#{instance}`") unless self === instance

        instance
      end

      def self.===(instance)
        instance == true || instance == false
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
monolens-0.6.4 lib/monolens/type/boolean.rb
monolens-0.6.3 lib/monolens/type/boolean.rb
monolens-0.6.2 lib/monolens/type/boolean.rb
monolens-0.6.1 lib/monolens/type/boolean.rb
monolens-0.6.0 lib/monolens/type/boolean.rb