Class: Wampproto::Message::Goodbye

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

Overview

abort message

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

type, #type

Constructor Details

#initialize(details, reason) ⇒ Goodbye



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

def initialize(details, reason)
  super()
  @details = Validate.hash!("Details", details)
  @reason = Validate.string!("Reason", reason)
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



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

def details
  @details
end

#reasonObject (readonly)

Returns the value of attribute reason.



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

def reason
  @reason
end

Class Method Details

.parse(wamp_message) ⇒ Object



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

def self.parse(wamp_message)
  _type, details, reason = Validate.greater_than_equal!(wamp_message, 3)
  new(details, reason)
end

Instance Method Details

#marshalObject



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

def marshal
  [Type::GOODBYE, details, reason]
end