Class: OFlow::Task::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/oflow/task.rb

Overview

Internal class used to store information about asynchronous method invocations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(op, box) ⇒ Request

Returns a new instance of Request.



382
383
384
385
# File 'lib/oflow/task.rb', line 382

def initialize(op, box)
  @op = op
  @box = box
end

Instance Attribute Details

#boxObject

Returns the value of attribute box.



380
381
382
# File 'lib/oflow/task.rb', line 380

def box
  @box
end

#opObject

Returns the value of attribute op.



379
380
381
# File 'lib/oflow/task.rb', line 379

def op
  @op
end

Instance Method Details

#describe(detail = 3) ⇒ Object



387
388
389
390
391
392
393
394
395
396
397
# File 'lib/oflow/task.rb', line 387

def describe(detail=3)
  if @box.nil?
    "#{@op}()"
  elsif 2 >= detail
    @op
  elsif 3 >= detail || @box.tracker.nil?
    "#{@op}(#{@box.contents})"
  else
    "#{@op}(#{@box.contents}) #{@box.tracker}"
  end
end