Class: NRSER::Types::Not
Overview
Instance Attribute Summary collapse
-
#type ⇒ Type
readonly
The type this one isn’t.
Instance Method Summary collapse
- #default_name ⇒ Object
- #default_symbolic ⇒ Object
- #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?, #symbolic, #test, #to_data, #to_proc, #to_s, #union, #xor
Constructor Details
Instance Attribute Details
#type ⇒ Type (readonly)
The type this one isn’t.
35 36 37 |
# File 'lib/nrser/types/not.rb', line 35 def type @type end |
Instance Method Details
#default_name ⇒ Object
61 62 63 |
# File 'lib/nrser/types/not.rb', line 61 def default_name "#{ NOT }#{ type.name }" end |
#default_symbolic ⇒ Object
56 57 58 |
# File 'lib/nrser/types/not.rb', line 56 def default_symbolic "#{ NRSER::Types.Top.symbolic }#{ COMPLEMENT }#{ type.symbolic }" end |
#explain ⇒ Object
66 67 68 |
# File 'lib/nrser/types/not.rb', line 66 def explain "#{ self.class.demod_name }<#{ type.explain }>" end |
#test?(value) ⇒ Boolean
Instance Methods
51 52 53 |
# File 'lib/nrser/types/not.rb', line 51 def test? value ! type.test( value ) end |