Class: Wamp::Client::Message::Yield
- Defined in:
- lib/wamp/client/message.rb
Overview
Yield Actual yield from an endpoint sent by a Callee to Dealer. Formats:
[YIELD, INVOCATION.Request|id, Options|dict]
[YIELD, INVOCATION.Request|id, Options|dict, Arguments|list]
[YIELD, INVOCATION.Request|id, Options|dict, Arguments|list, ArgumentsKw|dict]
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#argumentskw ⇒ Object
Returns the value of attribute argumentskw.
-
#invocation_request ⇒ Object
Returns the value of attribute invocation_request.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(invocation_request, options, arguments = nil, argumentskw = nil) ⇒ Yield
constructor
A new instance of Yield.
- #payload ⇒ Object
- #to_s ⇒ Object
Methods included from Check
Constructor Details
#initialize(invocation_request, options, arguments = nil, argumentskw = nil) ⇒ Yield
Returns a new instance of Yield.
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 |
# File 'lib/wamp/client/message.rb', line 1034 def initialize(invocation_request, , arguments=nil, argumentskw=nil) self.class.check_id('invocation_request', invocation_request) self.class.check_dict('options', ) self.class.check_list('arguments', arguments, true) self.class.check_dict('argumentskw', argumentskw, true) self.invocation_request = invocation_request self. = self.arguments = arguments self.argumentskw = argumentskw end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
1032 1033 1034 |
# File 'lib/wamp/client/message.rb', line 1032 def arguments @arguments end |
#argumentskw ⇒ Object
Returns the value of attribute argumentskw.
1032 1033 1034 |
# File 'lib/wamp/client/message.rb', line 1032 def argumentskw @argumentskw end |
#invocation_request ⇒ Object
Returns the value of attribute invocation_request.
1032 1033 1034 |
# File 'lib/wamp/client/message.rb', line 1032 def invocation_request @invocation_request end |
#options ⇒ Object
Returns the value of attribute options.
1032 1033 1034 |
# File 'lib/wamp/client/message.rb', line 1032 def @options end |
Class Method Details
.parse(params) ⇒ Object
1052 1053 1054 1055 1056 1057 1058 1059 1060 |
# File 'lib/wamp/client/message.rb', line 1052 def self.parse(params) self.check_gte('params list', 3, params.count) self.check_equal('message type', self.type, params[0]) params.shift self.new(*params) end |
Instance Method Details
#payload ⇒ Object
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 |
# File 'lib/wamp/client/message.rb', line 1062 def payload self.arguments ||= [] self.argumentskw ||= {} payload = [self.class.type] payload.push(self.invocation_request) payload.push(self.) return payload if (self.arguments.empty? and self.argumentskw.empty?) payload.push(self.arguments) return payload if (self.argumentskw.empty?) payload.push(self.argumentskw) payload end |
#to_s ⇒ Object
1079 1080 1081 |
# File 'lib/wamp/client/message.rb', line 1079 def to_s 'YIELD > ' + self.payload.to_s end |