Class: Pione::DRbPatch::ClientRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/pione/patch/drb-patch.rb

Overview

ClientRequest represents client's requests.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(req_id, obj, msg_id, argv, block, available) ⇒ ClientRequest

Returns a new instance of ClientRequest.



311
312
313
314
315
316
317
318
# File 'lib/pione/patch/drb-patch.rb', line 311

def initialize(req_id, obj, msg_id, argv, block, available)
  @req_id = req_id
  @obj = obj
  @msg_id = msg_id.intern
  @argv = argv
  @block = block
  @available = available
end

Instance Attribute Details

#argvObject (readonly)

Returns the value of attribute argv.



307
308
309
# File 'lib/pione/patch/drb-patch.rb', line 307

def argv
  @argv
end

#availableObject (readonly)

Returns the value of attribute available.



309
310
311
# File 'lib/pione/patch/drb-patch.rb', line 309

def available
  @available
end

#blockObject (readonly)

Returns the value of attribute block.



308
309
310
# File 'lib/pione/patch/drb-patch.rb', line 308

def block
  @block
end

#msg_idObject (readonly)

Returns the value of attribute msg_id.



306
307
308
# File 'lib/pione/patch/drb-patch.rb', line 306

def msg_id
  @msg_id
end

#objObject (readonly)

Returns the value of attribute obj.



305
306
307
# File 'lib/pione/patch/drb-patch.rb', line 305

def obj
  @obj
end

#req_idObject (readonly)

Returns the value of attribute req_id.



304
305
306
# File 'lib/pione/patch/drb-patch.rb', line 304

def req_id
  @req_id
end

Class Method Details

.receive(client) ⇒ Object



300
301
302
# File 'lib/pione/patch/drb-patch.rb', line 300

def self.receive(client)
  self.new(*client.recv_request)
end

Instance Method Details

#evalObject



320
321
322
323
324
325
326
# File 'lib/pione/patch/drb-patch.rb', line 320

def eval
  if @available
    @block ? eval_with_block : eval_without_block
  else
    raise BadRequestError
  end
end