Class: Knj::Process::Resultobject

Inherits:
Object
  • Object
show all
Defined in:
lib/knj/process.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Resultobject

Returns a new instance of Resultobject.



450
451
452
453
# File 'lib/knj/process.rb', line 450

def initialize(args)
  @args = args
  @answered = false
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



448
449
450
# File 'lib/knj/process.rb', line 448

def args
  @args
end

Instance Method Details

#answer(obj) ⇒ Object

Answers the call with the given object.



471
472
473
474
# File 'lib/knj/process.rb', line 471

def answer(obj)
  @answered = true
  @args[:process].answer(@args[:id], obj)
end

#answered?Boolean

Returns true if this result has been answered.

Returns:

  • (Boolean)


477
478
479
# File 'lib/knj/process.rb', line 477

def answered?
  return @answered
end

#idObject

Returns the ID this result-object should answer to.



466
467
468
# File 'lib/knj/process.rb', line 466

def id
  return @args[:id]
end

#objObject

The object that was passed to the current process/socket.



456
457
458
# File 'lib/knj/process.rb', line 456

def obj
  return @args[:obj]
end

#processObject

Returns the process that spawned this resultobject.



461
462
463
# File 'lib/knj/process.rb', line 461

def process
  return @args[:process]
end