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.



427
428
429
430
# File 'lib/knj/process.rb', line 427

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



425
426
427
# File 'lib/knj/process.rb', line 425

def args
  @args
end

Instance Method Details

#answer(obj) ⇒ Object

Answers the call with the given object.



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

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

#answered?Boolean

Returns true if this result has been answered.

Returns:

  • (Boolean)


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

def answered?
  return @answered
end

#idObject

Returns the ID this result-object should answer to.



443
444
445
# File 'lib/knj/process.rb', line 443

def id
  return @args[:id]
end

#objObject

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



433
434
435
# File 'lib/knj/process.rb', line 433

def obj
  return @args[:obj]
end

#processObject

Returns the process that spawned this resultobject.



438
439
440
# File 'lib/knj/process.rb', line 438

def process
  return @args[:process]
end