Class: Wampproto::Message::Challenge

Inherits:
Base
  • Object
show all
Defined in:
lib/wampproto/message/challenge.rb

Overview

Wamp Challenge message

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

type, #type

Constructor Details

#initialize(auth_method, extra = {}) ⇒ Challenge

Returns a new instance of Challenge.



9
10
11
12
13
# File 'lib/wampproto/message/challenge.rb', line 9

def initialize(auth_method, extra = {})
  super()
  @auth_method = Validate.string!("AuthMethod", auth_method)
  @extra = Validate.hash!("Extra", extra)
end

Instance Attribute Details

#auth_methodObject (readonly)

Returns the value of attribute auth_method.



7
8
9
# File 'lib/wampproto/message/challenge.rb', line 7

def auth_method
  @auth_method
end

#extraObject (readonly)

Returns the value of attribute extra.



7
8
9
# File 'lib/wampproto/message/challenge.rb', line 7

def extra
  @extra
end

Class Method Details

.parse(wamp_message) ⇒ Object



19
20
21
22
# File 'lib/wampproto/message/challenge.rb', line 19

def self.parse(wamp_message)
  _type, auth_method, extra = wamp_message
  new(auth_method, extra)
end

Instance Method Details

#marshalObject



15
16
17
# File 'lib/wampproto/message/challenge.rb', line 15

def marshal
  [Type::CHALLENGE, auth_method, extra]
end