Class: Alchemrest::Result::Ok
Instance Method Summary
collapse
Error, Ok, [], for, #transform, #unwrap_or_raise!, #unwrap_or_rescue
Constructor Details
#initialize(value) ⇒ Ok
rubocop:disable Lint/MissingSuper
11
12
13
|
# File 'lib/alchemrest/result.rb', line 11
def initialize(value) self.value = value
end
|
Instance Method Details
#==(other) ⇒ Object
15
16
17
|
# File 'lib/alchemrest/result.rb', line 15
def ==(other)
other.is_a?(Ok) && other.value == value
end
|
#deconstruct ⇒ Object
23
24
25
|
# File 'lib/alchemrest/result.rb', line 23
def deconstruct
[value]
end
|
#deconstruct_keys(_keys) ⇒ Object
27
28
29
|
# File 'lib/alchemrest/result.rb', line 27
def deconstruct_keys(_keys)
{ value: }
end
|
#ok? ⇒ Boolean
19
20
21
|
# File 'lib/alchemrest/result.rb', line 19
def ok?
true
end
|