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.



388
389
390
391
# File 'lib/oflow/task.rb', line 388

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

Instance Attribute Details

#boxObject

Returns the value of attribute box.



386
387
388
# File 'lib/oflow/task.rb', line 386

def box
  @box
end

#opObject

Returns the value of attribute op.



385
386
387
# File 'lib/oflow/task.rb', line 385

def op
  @op
end

Instance Method Details

#describe(detail = 3) ⇒ Object



393
394
395
396
397
398
399
400
401
402
403
# File 'lib/oflow/task.rb', line 393

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