Class: DeepConnect::Event::Reply
- Defined in:
- lib/deep-connect/event.rb
Direct Known Subclasses
AsyncronusReply, IteratorCallBackReply, IteratorReply, IteratorReplyFinish, MQReply, SessionReply
Instance Attribute Summary collapse
-
#exp ⇒ Object
readonly
Returns the value of attribute exp.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Attributes inherited from Event
Class Method Summary collapse
- .materialize_sub(session, type, klass, seq, receiver, method, ret, exp = nil) ⇒ Object
- .reply(session, req, ret, exp = nil) ⇒ Object
Instance Method Summary collapse
-
#initialize(session, seq, receiver, method, ret, exp = nil) ⇒ Reply
constructor
A new instance of Reply.
- #inspect ⇒ Object
- #request? ⇒ Boolean
- #serialize ⇒ Object
Constructor Details
#initialize(session, seq, receiver, method, ret, exp = nil) ⇒ Reply
Returns a new instance of Reply.
401 402 403 404 405 406 407 |
# File 'lib/deep-connect/event.rb', line 401 def initialize(session, seq, receiver, method, ret, exp=nil) super(session, receiver) @seq = seq @method = method @result = ret @exp = exp end |
Instance Attribute Details
#exp ⇒ Object (readonly)
Returns the value of attribute exp.
445 446 447 |
# File 'lib/deep-connect/event.rb', line 445 def exp @exp end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
446 447 448 |
# File 'lib/deep-connect/event.rb', line 446 def method @method end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
444 445 446 |
# File 'lib/deep-connect/event.rb', line 444 def result @result end |
Class Method Details
.materialize_sub(session, type, klass, seq, receiver, method, ret, exp = nil) ⇒ Object
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
# File 'lib/deep-connect/event.rb', line 381 def Reply.materialize_sub(session, type, klass, seq, receiver, method, ret, exp=nil) if exp type.new(session, seq, session.deep_space.root(receiver), method, Reference.materialize(session.deep_space, *ret), Reference.materialize(session.deep_space, *exp)) else type.new(session, seq, session.deep_space.root(receiver), method, Reference.materialize(session.deep_space, *ret)) end end |
.reply(session, req, ret, exp = nil) ⇒ Object
397 398 399 |
# File 'lib/deep-connect/event.rb', line 397 def self.reply(session, req, ret, exp=nil) new(session, req.seq, req.receiver, req.method, ret, exp) end |
Instance Method Details
#inspect ⇒ Object
448 449 450 |
# File 'lib/deep-connect/event.rb', line 448 def inspect sprintf "#<#{self.class}, session=#{@session}, seq=#{@seq}, receiver=#{@receiver}, method=#{@method} result=#{@result} exp=#{@exp}}>" end |
#request? ⇒ Boolean
440 441 442 |
# File 'lib/deep-connect/event.rb', line 440 def request? false end |
#serialize ⇒ Object
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/deep-connect/event.rb', line 409 def serialize mspec = @session.deep_space.my_method_spec(@receiver, @method) if mspec && mspec.rets if mspec.rets.kind_of?(Array) rets = mspec.rets_zip(@result){|spec, ret| Reference.serialize_with_spec(@session.deep_space, ret, spec) } sel_result = [:VAL, "Array", [Array, rets]] else sel_result = Reference.serialize(@session.deep_space, @result, mspec.rets) end else sel_result = Reference.serialize(@session.deep_space, @result) end if @exp [self.class, @seq, # Reference.serialize(@session.deep_space, @receiver), nil, @method, sel_result, Reference.serialize(@session.deep_space, @exp)] else [self.class, @seq, # Reference.serialize(@session.deep_space, @receiver), nil, @method, sel_result] end end |