Class: Opted::Result::Match::ErrMatch

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ ErrMatch

Returns a new instance of ErrMatch.



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

def initialize(error)
  @error = error
end

Instance Attribute Details

#mapped_value_or_errorObject (readonly)

Returns the value of attribute mapped_value_or_error.



39
40
41
# File 'lib/opted/result/match.rb', line 39

def mapped_value_or_error
  @mapped_value_or_error
end

Instance Method Details

#errObject



47
48
49
# File 'lib/opted/result/match.rb', line 47

def err
  @mapped_value_or_error = yield @error
end

#okObject



44
45
# File 'lib/opted/result/match.rb', line 44

def ok
end