class Dyph::Outcome::Resolved
Attributes
result[R]
Public Class Methods
new(result)
click to toggle source
# File lib/dyph/outcome/resolved.rb, line 4 def initialize(result) @result = result @combiner = ->(x, y) { x + y } end
Public Instance Methods
==(other)
click to toggle source
# File lib/dyph/outcome/resolved.rb, line 13 def ==(other) self.class == other.class && self.result == other.result end
Also aliased as: eql?
apply(fun)
click to toggle source
# File lib/dyph/outcome/resolved.rb, line 29 def apply(fun) Outcome::Resolved.new(fun[result]) end
combine(other)
click to toggle source
# File lib/dyph/outcome/resolved.rb, line 24 def combine(other) @result = @combiner[@result, other.result] self end
hash()
click to toggle source
# File lib/dyph/outcome/resolved.rb, line 20 def hash self.result.hash end
set_combiner(lambda)
click to toggle source
# File lib/dyph/outcome/resolved.rb, line 9 def set_combiner(lambda) @combiner = lambda end