class Ytry::Success
Public Class Methods
new(value)
click to toggle source
# File lib/ytry.rb, line 101 def initialize value @value = value.freeze end
Public Instance Methods
==(other)
click to toggle source
# File lib/ytry.rb, line 108 def == other other.is_a?(Success) && self.get == other.get end
===(other)
click to toggle source
# File lib/ytry.rb, line 111 def === other other.is_a?(Success) && self.get === other.get end
empty?()
click to toggle source
# File lib/ytry.rb, line 105 def empty?() false end
get()
click to toggle source
# File lib/ytry.rb, line 104 def get() @value end
recover(&block)
click to toggle source
# File lib/ytry.rb, line 114 def recover &block raise ArgumentError, 'missing block' unless block_given? self end
recover_with(&block)
click to toggle source
# File lib/ytry.rb, line 118 def recover_with &block raise ArgumentError, 'missing block' unless block_given? self end
to_ary()
click to toggle source
# File lib/ytry.rb, line 107 def to_ary() [get] end
to_s()
click to toggle source
# File lib/ytry.rb, line 106 def to_s() "Success(#{get})" end