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.



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

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



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

def args
  @args
end

Instance Method Details

#answer(obj) ⇒ Object

Answers the call with the given object.



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

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

#answered?Boolean

Returns true if this result has been answered.

Returns:

  • (Boolean)


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

def answered?
  return @answered
end

#idObject

Returns the ID this result-object should answer to.



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

def id
  return @args[:id]
end

#objObject

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



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

def obj
  return @args[:obj]
end

#processObject

Returns the process that spawned this resultobject.



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

def process
  return @args[:process]
end