Sha256: 11f339c5ba0fbd524fdfb7fc116f7e5125cec4defc94d6b84400f4b4718e8509

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

module Checked
  class Demand
    class Bools
        
      include Demand::Base

      namespace '/bool!'

      before
      def validate
        fail!("...must be either of TrueClass or FalseClass.") unless [TrueClass, FalseClass].include?(target.class)
      end
      
      route
      def true!
        fail! "...must be true (TrueClass)." unless target.class == TrueClass
      end
      
      route 
      def false!
        fail! "...must be false (FalseClass)." unless target.class == FalseClass
      end

    end # === class Bools
  end # === class Demand
end # === module Checked
        

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Checked-1.0.0 lib/Checked/Demand/Bools.rb