Class: Try::Failure

Inherits:
Base
  • Object
show all
Defined in:
lib/trither/try.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Try::Base

Instance Method Details

#fail_mapObject



27
28
29
# File 'lib/trither/try.rb', line 27

def fail_map
  Failure.new(yield @value)
end

#failure?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/trither/try.rb', line 15

def failure?
  true
end

#flat_mapObject



19
20
21
# File 'lib/trither/try.rb', line 19

def flat_map
  self
end

#get_or_else {|@value| ... } ⇒ Object

Yields:

  • (@value)


31
32
33
# File 'lib/trither/try.rb', line 31

def get_or_else
  yield @value
end

#mapObject



23
24
25
# File 'lib/trither/try.rb', line 23

def map
  self
end