Class: WampClient::Message::Hello
- Defined in:
- lib/wamp_client/message.rb
Overview
Hello Sent by a Client to initiate opening of a WAMP session to a Router attaching to a Realm. Formats:
[HELLO, Realm|uri, Details|dict]
Instance Attribute Summary collapse
-
#details ⇒ Object
Returns the value of attribute details.
-
#realm ⇒ Object
Returns the value of attribute realm.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(realm, details) ⇒ Hello
constructor
A new instance of Hello.
- #payload ⇒ Object
- #to_s ⇒ Object
Methods included from Check
Constructor Details
#initialize(realm, details) ⇒ Hello
Returns a new instance of Hello.
134 135 136 137 138 139 140 141 142 |
# File 'lib/wamp_client/message.rb', line 134 def initialize(realm, details) self.class.check_uri('realm', realm) self.class.check_dict('details', details) self.realm = realm self.details = details end |
Instance Attribute Details
#details ⇒ Object
Returns the value of attribute details.
132 133 134 |
# File 'lib/wamp_client/message.rb', line 132 def details @details end |
#realm ⇒ Object
Returns the value of attribute realm.
132 133 134 |
# File 'lib/wamp_client/message.rb', line 132 def realm @realm end |
Class Method Details
.parse(params) ⇒ Object
148 149 150 151 152 153 154 155 156 |
# File 'lib/wamp_client/message.rb', line 148 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
158 159 160 161 162 163 164 165 |
# File 'lib/wamp_client/message.rb', line 158 def payload payload = [self.class.type] payload.push(self.realm) payload.push(self.details) payload end |
#to_s ⇒ Object
167 168 169 |
# File 'lib/wamp_client/message.rb', line 167 def to_s 'HELLO > ' + self.payload.to_s end |