Class: NRSER::Types::Not
Instance Method Summary collapse
- #explain ⇒ Object
-
#initialize(type, **options) ⇒ Not
constructor
Instantiate a new ‘NRSER::Types::Not`.
-
#test?(value) ⇒ Boolean
Instance Methods ======================================================================.
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, ** super ** @type = type end |
Instance Method Details
#explain ⇒ Object
30 31 32 |
# File 'lib/nrser/types/not.rb', line 30 def explain "~#{ @type.name }" end |
#test?(value) ⇒ Boolean
Instance Methods
25 26 27 |
# File 'lib/nrser/types/not.rb', line 25 def test? value ! @type.test( value ) end |