Class: Wampproto::Message::Authenticate

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

Overview

Wamp Authenticate message

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

type, #type

Constructor Details

#initialize(signature, extra = {}) ⇒ Authenticate

Returns a new instance of Authenticate.



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

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

Instance Attribute Details

#extraObject (readonly)

Returns the value of attribute extra.



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

def extra
  @extra
end

#signatureObject (readonly)

Returns the value of attribute signature.



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

def signature
  @signature
end

Class Method Details

.parse(wamp_message) ⇒ Object



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

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

Instance Method Details

#marshalObject



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

def marshal
  [Type::AUTHENTICATE, signature, extra]
end