Class: NRSER::Types::Boolean
Overview
Instance Attribute Summary
Attributes inherited from Is
Instance Method Summary collapse
-
#initialize(value, **options) ⇒ Boolean
constructor
Instantiate a new ‘Boolean`.
Methods inherited from Is
#==, #default_symbolic, #explain, #test?
Methods inherited from Type
#===, #builtin_inspect, #check, #check!, #default_name, #default_symbolic, #explain, #from_data, #from_s, #has_from_data?, #has_from_s?, #has_to_data?, #inspect, #intersection, #name, #not, #respond_to?, #symbolic, #test, #test?, #to_data, #to_proc, #to_s, #union, #xor
Constructor Details
#initialize(value, **options) ⇒ Boolean
Instantiate a new ‘Boolean`.
34 35 36 37 38 39 40 41 42 |
# File 'lib/nrser/types/booleans.rb', line 34 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 |