Class: NRSER::Types::Not

Inherits:
Type show all
Defined in:
lib/nrser/types/not.rb

Instance Method Summary collapse

Methods inherited from Type

#===, #builtin_inspect, #check, #check!, #from_data, #from_s, #has_from_data?, #has_from_s?, #has_to_data?, #inspect, #intersection, #name, #not, #respond_to?, #test, #to_data, #to_s, #union, #xor

Constructor Details

#initialize(type, **options) ⇒ Not

Instantiate a new ‘NRSER::Types::Not`.



16
17
18
19
# File 'lib/nrser/types/not.rb', line 16

def initialize type, **options
  super **options
  @type = type
end

Instance Method Details

#explainObject



30
31
32
# File 'lib/nrser/types/not.rb', line 30

def explain
  "~#{ @type.name }"
end

#test?(value) ⇒ Boolean

Instance Methods

Returns:

  • (Boolean)


25
26
27
# File 'lib/nrser/types/not.rb', line 25

def test? value
  ! @type.test( value )
end