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.



513
514
515
516
# File 'lib/oflow/task.rb', line 513

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

Instance Attribute Details

#boxObject

Returns the value of attribute box.



511
512
513
# File 'lib/oflow/task.rb', line 511

def box
  @box
end

#opObject

Returns the value of attribute op.



510
511
512
# File 'lib/oflow/task.rb', line 510

def op
  @op
end

Instance Method Details

#describe(detail = 3) ⇒ Object



518
519
520
521
522
523
524
525
526
527
528
# File 'lib/oflow/task.rb', line 518

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