Class: WampClient::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.
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 |
# File 'lib/wamp_client/message.rb', line 1112 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.
1110 1111 1112 |
# File 'lib/wamp_client/message.rb', line 1110 def arguments @arguments end |
#argumentskw ⇒ Object
Returns the value of attribute argumentskw.
1110 1111 1112 |
# File 'lib/wamp_client/message.rb', line 1110 def argumentskw @argumentskw end |
#invocation_request ⇒ Object
Returns the value of attribute invocation_request.
1110 1111 1112 |
# File 'lib/wamp_client/message.rb', line 1110 def invocation_request @invocation_request end |
#options ⇒ Object
Returns the value of attribute options.
1110 1111 1112 |
# File 'lib/wamp_client/message.rb', line 1110 def end |
Class Method Details
.parse(params) ⇒ Object
1130 1131 1132 1133 1134 1135 1136 1137 1138 |
# File 'lib/wamp_client/message.rb', line 1130 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 |
.type ⇒ Object
1126 1127 1128 |
# File 'lib/wamp_client/message.rb', line 1126 def self.type Types::YIELD end |
Instance Method Details
#payload ⇒ Object
1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 |
# File 'lib/wamp_client/message.rb', line 1140 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
1157 1158 1159 |
# File 'lib/wamp_client/message.rb', line 1157 def to_s 'YIELD > ' + self.payload.to_s end |