Class: AMF::Messages::AbstractMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/amf/messages.rb

Overview

Base class for all special AS3 response messages. Maps to flex.messaging.messages.AbstractMessage

Direct Known Subclasses

AsyncMessage, RemotingMessage

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



11
12
13
# File 'lib/amf/messages.rb', line 11

def body
  @body
end

#client_idObject

Returns the value of attribute client_id.



6
7
8
# File 'lib/amf/messages.rb', line 6

def client_id
  @client_id
end

#headersObject

Returns the value of attribute headers.



10
11
12
# File 'lib/amf/messages.rb', line 10

def headers
  @headers
end

#message_idObject

Returns the value of attribute message_id.



7
8
9
# File 'lib/amf/messages.rb', line 7

def message_id
  @message_id
end

#time_to_liveObject

Returns the value of attribute time_to_live.



9
10
11
# File 'lib/amf/messages.rb', line 9

def time_to_live
  @time_to_live
end

#timestampObject

Returns the value of attribute timestamp.



8
9
10
# File 'lib/amf/messages.rb', line 8

def timestamp
  @timestamp
end

Instance Method Details

#to_amf(options = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/amf/messages.rb', line 13

def to_amf(options = {})
  options[:amf_version] ||= 3
  options[:serializable_names] = (self.public_methods - Object.new.public_methods).delete_if { |elm| elm =~ /to_amf|body|.*=/ }
          
  AMF.serialize(self, options) do |s|
    if body
      s.write_utf8_vr("body")
      s.stream << body
    end
  end
end