Class: Faye::Envelope

Inherits:
Object
  • Object
show all
Includes:
Deferrable
Defined in:
lib/faye/protocol/envelope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Deferrable

#set_deferred_status

Constructor Details

#initialize(message, timeout = nil) ⇒ Envelope

Returns a new instance of Envelope.



7
8
9
10
11
12
# File 'lib/faye/protocol/envelope.rb', line 7

def initialize(message, timeout = nil)
  @id      = message['id']
  @message = message
  
  self.timeout(timeout, false) if timeout
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/faye/protocol/envelope.rb', line 5

def id
  @id
end

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/faye/protocol/envelope.rb', line 5

def message
  @message
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/faye/protocol/envelope.rb', line 14

def eql?(other)
  Envelope === other and @id == other.id
end

#hashObject



18
19
20
# File 'lib/faye/protocol/envelope.rb', line 18

def hash
  @id.hash
end