Class: NRSER::Types::BooleanType
- Defined in:
- lib/nrser/types/booleans.rb
Overview
Instance Attribute Summary
Attributes inherited from Is
Instance Method Summary collapse
-
#initialize(value, **options) ⇒ BooleanType
constructor
Instantiate a new ‘BooleanType`.
Methods inherited from Is
Methods inherited from Type
#===, #builtin_inspect, #check, #check!, #explain, #from_data, #from_s, #has_from_data?, #has_from_s?, #has_to_data?, #inspect, #intersection, #name, #not, #respond_to?, #test, #test?, #to_data, #to_s, #union, #xor
Constructor Details
#initialize(value, **options) ⇒ BooleanType
Instantiate a new ‘BooleanType`.
20 21 22 23 24 25 26 27 28 |
# File 'lib/nrser/types/booleans.rb', line 20 def initialize value, ** # Check it's a boolean unless true.equal?( value ) || false.equal?( value ) raise ArgumentError.new \ "`value` arg must be `true` or `false`, found #{ value.inspect }" end super value, ** end |