Class: Either::Match::Evaluation

Inherits:
Object
  • Object
show all
Defined in:
lib/either/match.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(match, either) ⇒ Evaluation



35
36
37
38
# File 'lib/either/match.rb', line 35

def initialize(match, either)
  @match  = match
  @either = either
end

Instance Attribute Details

#eitherObject (readonly)

Returns the value of attribute either.



40
41
42
# File 'lib/either/match.rb', line 40

def either
  @either
end

#matchObject (readonly)

Returns the value of attribute match.



40
41
42
# File 'lib/either/match.rb', line 40

def match
  @match
end

Instance Method Details

#resultObject



42
43
44
# File 'lib/either/match.rb', line 42

def result
  either.left? ? left_result : right_result
end