Module: L43::Time::Tools::MapOk

Included in:
FormatTime, L43::Time::ToTime
Defined in:
lib/l43/time/tools/map_ok.rb

Instance Method Summary collapse

Instance Method Details

#map_ok(exception: RuntimeError, &blk) ⇒ Object



7
8
9
10
11
# File 'lib/l43/time/tools/map_ok.rb', line 7

def map_ok(exception: RuntimeError, &blk)
  [:ok, blk.()]
rescue exception => e
  [:error, e.message]
end