Class: Typed::Some
- Extended by:
- T::Generic, T::Sig
- Defined in:
- lib/typed/option.rb
Constant Summary collapse
- Payload =
type_member
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(payload) ⇒ Some
constructor
A new instance of Some.
- #none? ⇒ Boolean
- #payload_or(_value) ⇒ Object
- #some? ⇒ Boolean
Constructor Details
#initialize(payload) ⇒ Some
Returns a new instance of Some.
59 60 61 62 |
# File 'lib/typed/option.rb', line 59 def initialize(payload) @payload = payload super() end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
47 48 49 |
# File 'lib/typed/option.rb', line 47 def payload @payload end |
Class Method Details
.new(payload) ⇒ Object
54 55 56 |
# File 'lib/typed/option.rb', line 54 def self.new(payload) super(payload) end |
Instance Method Details
#none? ⇒ Boolean
70 71 72 |
# File 'lib/typed/option.rb', line 70 def none? false end |
#payload_or(_value) ⇒ Object
80 81 82 |
# File 'lib/typed/option.rb', line 80 def payload_or(_value) payload end |
#some? ⇒ Boolean
65 66 67 |
# File 'lib/typed/option.rb', line 65 def some? true end |