Class: Wampproto::Message::Welcome
- Defined in:
- lib/wampproto/message/welcome.rb
Overview
welcome message
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
Class Method Summary collapse
Instance Method Summary collapse
- #authextra ⇒ Object
- #authid ⇒ Object
- #authmethod ⇒ Object
- #authrole ⇒ Object
-
#initialize(session_id, details = {}) ⇒ Welcome
constructor
A new instance of Welcome.
- #marshal ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(session_id, details = {}) ⇒ Welcome
Returns a new instance of Welcome.
9 10 11 12 13 |
# File 'lib/wampproto/message/welcome.rb', line 9 def initialize(session_id, details = {}) super() @session_id = Validate.int!("Session Id", session_id) @details = Validate.hash!("Details", details) end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
7 8 9 |
# File 'lib/wampproto/message/welcome.rb', line 7 def details @details end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
7 8 9 |
# File 'lib/wampproto/message/welcome.rb', line 7 def session_id @session_id end |
Class Method Details
.parse(wamp_message) ⇒ Object
35 36 37 38 |
# File 'lib/wampproto/message/welcome.rb', line 35 def self.parse() _type, session_id, details = new(session_id, details) end |
Instance Method Details
#authextra ⇒ Object
31 32 33 |
# File 'lib/wampproto/message/welcome.rb', line 31 def authextra @authextra ||= details.fetch(:authextra) if details.member?(:authextra) end |
#authid ⇒ Object
23 24 25 |
# File 'lib/wampproto/message/welcome.rb', line 23 def authid @authid ||= details[:authid] end |
#authmethod ⇒ Object
27 28 29 |
# File 'lib/wampproto/message/welcome.rb', line 27 def authmethod @authmethod ||= details[:authmethod] end |
#authrole ⇒ Object
19 20 21 |
# File 'lib/wampproto/message/welcome.rb', line 19 def authrole @authrole ||= details.fetch(:authrole, []) end |
#marshal ⇒ Object
15 16 17 |
# File 'lib/wampproto/message/welcome.rb', line 15 def marshal [Type::WELCOME, @session_id, @details] end |