Class: Delivered::NilableType
- Inherits:
-
Object
- Object
- Delivered::NilableType
- Defined in:
- lib/delivered/types.rb
Instance Method Summary collapse
- #===(value) ⇒ Object
-
#initialize(type = nil) ⇒ NilableType
constructor
A new instance of NilableType.
- #inspect ⇒ Object
Constructor Details
#initialize(type = nil) ⇒ NilableType
Returns a new instance of NilableType.
29 30 31 |
# File 'lib/delivered/types.rb', line 29 def initialize(type = nil) @type = type end |
Instance Method Details
#===(value) ⇒ Object
35 36 37 |
# File 'lib/delivered/types.rb', line 35 def ===(value) (@type.nil? ? true : nil === value) || @type === value end |
#inspect ⇒ Object
33 |
# File 'lib/delivered/types.rb', line 33 def inspect = "Nilable(#{@type&.inspect || 'Any'})" |