Class: NRSER::Types::AnyType
Overview
A type for anything - #test? always returns ‘true`.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
AnyType instances are all equal.
- #custom_from_s(string) ⇒ Object
- #explain ⇒ Object
- #test?(value) ⇒ Boolean
Methods inherited from Type
#===, #builtin_inspect, #check, #check!, #from_data, #from_s, #has_from_data?, #has_from_s?, #has_to_data?, #initialize, #inspect, #intersection, #name, #not, #respond_to?, #test, #to_data, #to_s, #union, #xor
Constructor Details
This class inherits a constructor from NRSER::Types::Type
Instance Method Details
#==(other) ⇒ Boolean
Note:
‘other`’s class must be NRSER::Types::AnyType exactly - we make no assumptions about anything that has subclasses NRSER::Types::AnyType.
NRSER::Types::AnyType instances are all equal.
26 27 28 |
# File 'lib/nrser/types/any.rb', line 26 def == other other.class == AnyType end |
#custom_from_s(string) ⇒ Object
12 |
# File 'lib/nrser/types/any.rb', line 12 def custom_from_s string; string; end |
#explain ⇒ Object
11 |
# File 'lib/nrser/types/any.rb', line 11 def explain; '*'; end |
#test?(value) ⇒ Boolean
10 |
# File 'lib/nrser/types/any.rb', line 10 def test? value; true; end |