abstract class Crommand::Optional(T)
- Crommand::Optional(T)
- Reference
- Object
Overview
An abstract base class for the optional types. An optional represents a value that may or may not have been set.
Direct Known Subclasses
Defined in:
optional.crInstance Method Summary
-
#if_set(&) : Optional
Calling this method and passing it a block will result in the mthod yielding the optional value if and only it it has been set.
-
#if_unset(&) : Optional
Calling this method and passing it a block will result in the mthod yielding to the block if and only it it has not been set.
-
#set? : Bool
Used to test whether the optional has a value available or not.
-
#value : T
An abstract method that derived classes must provide an implementation for.
Instance Method Detail
Calling this method and passing it a block will result in the mthod yielding the optional value if and only it it has been set. This method returns self to allow for chaining.
Calling this method and passing it a block will result in the mthod yielding to the block if and only it it has not been set. This method returns self to allow for chaining.
Used to test whether the optional has a value available or not. THis default implementation returns false.
An abstract method that derived classes must provide an implementation for.