Class: ASIR::Message
- Inherits:
-
Object
- Object
- ASIR::Message
- Includes:
- AdditionalData, CodeMore, Identity
- Defined in:
- lib/asir/message.rb,
lib/asir/message/delay.rb,
lib/asir/message/state.rb,
lib/asir/transport/delay.rb
Overview
!SLIDE Message
Encapsulate the Ruby message from the Client to be handled by the Service.
Defined Under Namespace
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#block ⇒ Object
Returns the value of attribute block.
-
#delay ⇒ Object
Optional: Specifies the Numeric seconds or absolute Time for the Transport to delay the Message until actual invocation.
-
#one_way ⇒ Object
Returns the value of attribute one_way.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
-
#receiver_class ⇒ Object
Returns the value of attribute receiver_class.
-
#result ⇒ Object
Returns the value of attribute result.
-
#selector ⇒ Object
Returns the value of attribute selector.
Attributes included from Identity
Attributes included from CodeMore
Instance Method Summary collapse
-
#initialize(r, s, a, b, p) ⇒ Message
constructor
A new instance of Message.
- #invoke! ⇒ Object
Methods included from AdditionalData
#[], #[]=, #_additional_data, #additional_data, #additional_data!, #additional_data=, included
Methods included from Identity
#create_identifier!, #create_timestamp!
Methods included from CodeMore
#decode_more!, #description, #encode_more!, #message_kind
Methods included from CodeBlock
block_cache, block_to_code, code_to_block, #decode_block!, #encode_block!
Methods included from ObjectResolving
Constructor Details
#initialize(r, s, a, b, p) ⇒ Message
Returns a new instance of Message.
12 13 14 15 16 17 |
# File 'lib/asir/message.rb', line 12 def initialize r, s, a, b, p @receiver, @selector, @arguments = r, s, a @block = b if b @receiver_class = @receiver.class @one_way = p._one_way if p end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
9 10 11 |
# File 'lib/asir/message.rb', line 9 def arguments @arguments end |
#block ⇒ Object
Returns the value of attribute block.
9 10 11 |
# File 'lib/asir/message.rb', line 9 def block @block end |
#delay ⇒ Object
Optional: Specifies the Numeric seconds or absolute Time for the Transport to delay the Message until actual invocation.
28 29 30 |
# File 'lib/asir/message.rb', line 28 def delay @delay end |
#one_way ⇒ Object
Returns the value of attribute one_way.
10 11 12 |
# File 'lib/asir/message.rb', line 10 def one_way @one_way end |
#receiver ⇒ Object
Returns the value of attribute receiver.
9 10 11 |
# File 'lib/asir/message.rb', line 9 def receiver @receiver end |
#receiver_class ⇒ Object
Returns the value of attribute receiver_class.
9 10 11 |
# File 'lib/asir/message.rb', line 9 def receiver_class @receiver_class end |
#result ⇒ Object
Returns the value of attribute result.
10 11 12 |
# File 'lib/asir/message.rb', line 10 def result @result end |
#selector ⇒ Object
Returns the value of attribute selector.
9 10 11 |
# File 'lib/asir/message.rb', line 9 def selector @selector end |
Instance Method Details
#invoke! ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/asir/message.rb', line 19 def invoke! @result = Result.new(self, @receiver.__send__(@selector, *@arguments)) rescue *Error::Unforwardable.unforwardable => exc @result = Result.new(self, nil, Error::Unforwardable.new(exc)) rescue ::Exception => exc @result = Result.new(self, nil, exc) end |