Class: Ree::Contracts::ArgContracts::Bool
- Extended by:
- Truncatable
- Defined in:
- lib/ree/contracts/arg_contracts/bool.rb
Class Method Summary collapse
Methods included from Truncatable
Class Method Details
.message(value, name, lvl = 1) ⇒ Object
12 13 14 |
# File 'lib/ree/contracts/arg_contracts/bool.rb', line 12 def self.(value, name, lvl = 1) "expected Bool, got #{value.class} => #{truncate(value.inspect)}" end |
.to_s ⇒ Object
16 17 18 |
# File 'lib/ree/contracts/arg_contracts/bool.rb', line 16 def self.to_s "Bool" end |
.valid?(value) ⇒ Boolean
8 9 10 |
# File 'lib/ree/contracts/arg_contracts/bool.rb', line 8 def self.valid?(value) value.is_a?(TrueClass) || value.is_a?(FalseClass) end |