Class: Wamp::Client::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.
56 57 58 59 60 61 62 63 64 |
# File 'lib/wamp/client/message.rb', line 56 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.
54 55 56 |
# File 'lib/wamp/client/message.rb', line 54 def details @details end |
#realm ⇒ Object
Returns the value of attribute realm.
54 55 56 |
# File 'lib/wamp/client/message.rb', line 54 def realm @realm end |
Class Method Details
.parse(params) ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'lib/wamp/client/message.rb', line 70 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
80 81 82 83 84 85 86 87 |
# File 'lib/wamp/client/message.rb', line 80 def payload payload = [self.class.type] payload.push(self.realm) payload.push(self.details) payload end |
#to_s ⇒ Object
89 90 91 |
# File 'lib/wamp/client/message.rb', line 89 def to_s 'HELLO > ' + self.payload.to_s end |