Class: Solana::Ruby::Kit::Options::Some
- Inherits:
-
Object
- Object
- Solana::Ruby::Kit::Options::Some
- Extended by:
- T::Generic, T::Sig
- Defined in:
- lib/solana/ruby/kit/options/option.rb
Overview
Represents the presence of a value — mirrors TypeScript’s ‘Some<T>`.
Constant Summary collapse
- Elem =
type_member
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ Some
constructor
A new instance of Some.
- #inspect ⇒ Object
Constructor Details
#initialize(value) ⇒ Some
Returns a new instance of Some.
24 25 26 |
# File 'lib/solana/ruby/kit/options/option.rb', line 24 def initialize(value) @value = T.let(value, Elem) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
21 22 23 |
# File 'lib/solana/ruby/kit/options/option.rb', line 21 def value @value end |
Instance Method Details
#==(other) ⇒ Object
32 33 34 |
# File 'lib/solana/ruby/kit/options/option.rb', line 32 def ==(other) !!(other.is_a?(Some) && T.unsafe(value) == T.unsafe(other.value)) end |
#inspect ⇒ Object
29 |
# File 'lib/solana/ruby/kit/options/option.rb', line 29 def inspect = "Some(#{T.unsafe(@value).inspect})" |