Class: RocketAMF::Request

Inherits:
Object
  • Object
show all
Includes:
Pure::Request
Defined in:
lib/rocketamf/pure.rb,
lib/rocketamf/remoting.rb

Overview

Container for the AMF request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Pure::ReadIOHelpers

#byte_order, #byte_order_little?, #read_double, #read_int16_network, #read_int8, #read_word16_network, #read_word32_network, #read_word8

Constructor Details

#initializeRequest

Returns a new instance of Request.



6
7
8
9
10
# File 'lib/rocketamf/remoting.rb', line 6

def initialize
  @amf_version = 0
  @headers = []
  @messages = []
end

Instance Attribute Details

#amf_versionObject (readonly)

Returns the value of attribute amf_version.



4
5
6
# File 'lib/rocketamf/remoting.rb', line 4

def amf_version
  @amf_version
end

#headersObject (readonly)

Returns the value of attribute headers.



4
5
6
# File 'lib/rocketamf/remoting.rb', line 4

def headers
  @headers
end

#messagesObject (readonly)

Returns the value of attribute messages.



4
5
6
# File 'lib/rocketamf/remoting.rb', line 4

def messages
  @messages
end

Instance Method Details

#populate_from_stream(stream) ⇒ Object

Populates the request from the given stream or string. Returns self for easy chaining

Example:

req = RocketAMF::Request.new.populate_from_stream(env['rack.input'].read)

– Implemented in pure/remoting.rb RocketAMF::Pure::Request

Raises:



20
21
22
# File 'lib/rocketamf/remoting.rb', line 20

def populate_from_stream stream
  raise AMFError, 'Must load "rocketamf/pure"'
end