Class: Parameters::Types::Type
Class Method Summary collapse
-
.===(value) ⇒ Boolean
abstract
Determines if the value is an instance of the Type.
-
.coerce(value) ⇒ Object
abstract
Coerces an Object into an instances of the Type.
-
.to_ruby ⇒ Class
abstract
The Ruby Class the type represents.
Instance Method Summary collapse
-
#<(other) ⇒ ::Boolean
Determines if the instance of the type is related to another Type.
-
#<=(other) ⇒ ::Boolean
Compares the type to another instance or class type.
-
#==(other) ⇒ ::Boolean
Compares the instance type to another instance type.
- #===(value) ⇒ Object
- #coerce(value) ⇒ Object
- #to_ruby ⇒ Object
Class Method Details
.===(value) ⇒ Boolean
This method is abstract.
Determines if the value is an instance of the Type.
31 32 33 |
# File 'lib/parameters/types/type.rb', line 31 def self.===(value) false end |
.coerce(value) ⇒ Object
This method is abstract.
Coerces an Object into an instances of the Type.
46 47 |
# File 'lib/parameters/types/type.rb', line 46 def self.coerce(value) end |
.to_ruby ⇒ Class
This method is abstract.
The Ruby Class the type represents.
13 14 |
# File 'lib/parameters/types/type.rb', line 13 def self.to_ruby end |
Instance Method Details
#<(other) ⇒ ::Boolean
Determines if the instance of the type is related to another Type.
77 78 79 80 81 82 83 |
# File 'lib/parameters/types/type.rb', line 77 def <(other) if other.kind_of?(Type) self.class <= other.class else self.class <= other end end |
#<=(other) ⇒ ::Boolean
Compares the type to another instance or class type.
97 98 99 |
# File 'lib/parameters/types/type.rb', line 97 def <=(other) (self < other) || (self == other) end |
#==(other) ⇒ ::Boolean
Compares the instance type to another instance type.
61 62 63 |
# File 'lib/parameters/types/type.rb', line 61 def ==(other) self.class == other.class end |
#===(value) ⇒ Object
104 105 106 |
# File 'lib/parameters/types/type.rb', line 104 def ===(value) self.class === value end |
#coerce(value) ⇒ Object
111 112 113 |
# File 'lib/parameters/types/type.rb', line 111 def coerce(value) self.class.coerce(value) end |
#to_ruby ⇒ Object
19 20 21 |
# File 'lib/parameters/types/type.rb', line 19 def to_ruby self.class.to_ruby end |