Class: WampClient::Message::Invocation
- Defined in:
- lib/wamp_client/message.rb
Overview
Invocation Actual invocation of an endpoint sent by Dealer to a Callee. Formats:
[INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict]
[INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, CALL.Arguments|list]
[INVOCATION, Request|id, REGISTERED.Registration|id, Details|dict, CALL.Arguments|list, CALL.ArgumentsKw|dict]
Instance Attribute Summary collapse
-
#call_arguments ⇒ Object
Returns the value of attribute call_arguments.
-
#call_argumentskw ⇒ Object
Returns the value of attribute call_argumentskw.
-
#details ⇒ Object
Returns the value of attribute details.
-
#registered_registration ⇒ Object
Returns the value of attribute registered_registration.
-
#request ⇒ Object
Returns the value of attribute request.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(request, registered_registration, details, call_arguments = nil, call_argumentskw = nil) ⇒ Invocation
constructor
A new instance of Invocation.
- #payload ⇒ Object
- #to_s ⇒ Object
Methods included from Check
Constructor Details
#initialize(request, registered_registration, details, call_arguments = nil, call_argumentskw = nil) ⇒ Invocation
Returns a new instance of Invocation.
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 |
# File 'lib/wamp_client/message.rb', line 1021 def initialize(request, registered_registration, details, call_arguments=nil, call_argumentskw=nil) self.class.check_id('request', request) self.class.check_id('registered_registration', registered_registration) self.class.check_dict('details', details) self.class.check_list('call_arguments', call_arguments, true) self.class.check_dict('call_argumentskw', call_argumentskw, true) self.request = request self.registered_registration = registered_registration self.details = details self.call_arguments = call_arguments self.call_argumentskw = call_argumentskw end |
Instance Attribute Details
#call_arguments ⇒ Object
Returns the value of attribute call_arguments.
1019 1020 1021 |
# File 'lib/wamp_client/message.rb', line 1019 def call_arguments @call_arguments end |
#call_argumentskw ⇒ Object
Returns the value of attribute call_argumentskw.
1019 1020 1021 |
# File 'lib/wamp_client/message.rb', line 1019 def call_argumentskw @call_argumentskw end |
#details ⇒ Object
Returns the value of attribute details.
1019 1020 1021 |
# File 'lib/wamp_client/message.rb', line 1019 def details @details end |
#registered_registration ⇒ Object
Returns the value of attribute registered_registration.
1019 1020 1021 |
# File 'lib/wamp_client/message.rb', line 1019 def registered_registration @registered_registration end |
#request ⇒ Object
Returns the value of attribute request.
1019 1020 1021 |
# File 'lib/wamp_client/message.rb', line 1019 def request @request end |
Class Method Details
.parse(params) ⇒ Object
1041 1042 1043 1044 1045 1046 1047 1048 1049 |
# File 'lib/wamp_client/message.rb', line 1041 def self.parse(params) self.check_gte('params list', 4, params.count) self.check_equal('message type', self.type, params[0]) params.shift self.new(*params) end |
.type ⇒ Object
1037 1038 1039 |
# File 'lib/wamp_client/message.rb', line 1037 def self.type Types::INVOCATION end |
Instance Method Details
#payload ⇒ Object
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 |
# File 'lib/wamp_client/message.rb', line 1051 def payload payload = [self.class.type] payload.push(self.request) payload.push(self.registered_registration) payload.push(self.details) return payload if (self.call_arguments.nil? or self.call_arguments.empty?) payload.push(self.call_arguments) return payload if (self.call_argumentskw.nil? or self.call_argumentskw.empty?) payload.push(self.call_argumentskw) payload end |
#to_s ⇒ Object
1066 1067 1068 |
# File 'lib/wamp_client/message.rb', line 1066 def to_s 'INVOCATION > ' + self.payload.to_s end |