Class: Jade::Task::MapError

Inherits:
Data
  • Object
show all
Includes:
Jade::Task
Defined in:
lib/jade/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fnObject (readonly)

Returns the value of attribute fn

Returns:

  • (Object)

    the current value of fn



54
55
56
# File 'lib/jade/task.rb', line 54

def fn
  @fn
end

#taskObject (readonly)

Returns the value of attribute task

Returns:

  • (Object)

    the current value of task



54
55
56
# File 'lib/jade/task.rb', line 54

def task
  @task
end

Instance Method Details

#runObject



57
58
59
60
61
62
# File 'lib/jade/task.rb', line 57

def run
  case task.run
  in Jade::Result::Ok => ok    then ok
  in Jade::Result::Err[error]  then Jade::Result::Err[fn.call(error)]
  end
end