Module: AMF
- Includes:
- Pure
- Defined in:
- lib/amf.rb,
lib/amf/pure.rb,
lib/amf/common.rb,
lib/amf/version.rb,
lib/amf/constants.rb,
lib/amf/class_mapping.rb,
lib/amf/pure/remoting.rb,
lib/amf/pure/io_helpers.rb,
lib/amf/pure/serializer.rb,
lib/amf/values/messages.rb,
lib/amf/pure/deserializer.rb,
lib/amf/values/typed_hash.rb,
lib/amf/values/array_collection.rb
Defined Under Namespace
Modules: Pure, Values Classes: AMFError, ClassMapping
Constant Summary collapse
- ClassMapper =
AMF::ClassMapping.new
- VERSION =
AMF version
'0.0.1'
- VERSION_ARRAY =
:nodoc:
VERSION.split(/\./).map { |x| x.to_i }
- VERSION_MAJOR =
:nodoc:
VERSION_ARRAY[0]
- VERSION_MINOR =
:nodoc:
VERSION_ARRAY[1]
- VERSION_BUILD =
:nodoc:
VERSION_ARRAY[2]
- VARIANT_BINARY =
false
- AMF0_NUMBER_MARKER =
AMF0 Type Markers
0x00
- AMF0_BOOLEAN_MARKER =
“000”
0x01
- AMF0_STRING_MARKER =
“001”
0x02
- AMF0_OBJECT_MARKER =
“002”
0x03
- AMF0_MOVIE_CLIP_MARKER =
“003”
0x04
- AMF0_NULL_MARKER =
“004” # Unused
0x05
- AMF0_UNDEFINED_MARKER =
“005”
0x06
- AMF0_REFERENCE_MARKER =
“006”
0x07
- AMF0_HASH_MARKER =
“a”
0x08
- AMF0_OBJECT_END_MARKER =
“b”
0x09
- AMF0_STRICT_ARRAY_MARKER =
“t”
0x0A
- AMF0_DATE_MARKER =
“n”
0x0B
- AMF0_LONG_STRING_MARKER =
“v”
0x0C
- AMF0_UNSUPPORTED_MARKER =
“f”
0x0D
- AMF0_RECORDSET_MARKER =
“r”
0x0E
- AMF0_XML_MARKER =
“016” # Unused
0x0F
- AMF0_TYPED_OBJECT_MARKER =
“017”
0x10
- AMF0_AMF3_MARKER =
“020”
0x11
- AMF3_UNDEFINED_MARKER =
AMF3 Type Markers
0x00
- AMF3_NULL_MARKER =
“000”
0x01
- AMF3_FALSE_MARKER =
“001”
0x02
- AMF3_TRUE_MARKER =
“002”
0x03
- AMF3_INTEGER_MARKER =
“003”
0x04
- AMF3_DOUBLE_MARKER =
“004”
0x05
- AMF3_STRING_MARKER =
“005”
0x06
- AMF3_XML_DOC_MARKER =
“006”
0x07
- AMF3_DATE_MARKER =
“a”
0x08
- AMF3_ARRAY_MARKER =
“b”
0x09
- AMF3_OBJECT_MARKER =
“t”
0x0A
- AMF3_XML_MARKER =
“n”
0x0B
- AMF3_BYTE_ARRAY_MARKER =
“v”
0x0C
- EMPTY_STRING =
Other Markers
0x01
- ANONYMOUS_OBJECT =
0x01
- DYNAMIC_OBJECT =
0x0B
- CLOSE_DYNAMIC_OBJECT =
0x01
- CLOSE_DYNAMIC_ARRAY =
0x01
- MAX_INTEGER =
268435455
- MIN_INTEGER =
-268435456
Class Method Summary collapse
-
.deserialize(source, amf_version = 0) ⇒ Object
Deserialize the AMF string source into a Ruby data structure and return it.
-
.serialize(obj, amf_version = 0) ⇒ Object
Serialize the given Ruby data structure obj into an AMF stream.
Class Method Details
.deserialize(source, amf_version = 0) ⇒ Object
Deserialize the AMF string source into a Ruby data structure and return it.
4 5 6 7 8 9 10 11 12 |
# File 'lib/amf/common.rb', line 4 def deserialize source, amf_version = 0 if amf_version == 0 AMF::Deserializer.new.deserialize(source) elsif amf_version == 3 AMF::AMF3Deserializer.new.deserialize(source) else raise AMFError, "unsupported version #{amf_version}" end end |
.serialize(obj, amf_version = 0) ⇒ Object
Serialize the given Ruby data structure obj into an AMF stream
15 16 17 18 19 20 21 22 23 |
# File 'lib/amf/common.rb', line 15 def serialize obj, amf_version = 0 if amf_version == 0 AMF::Serializer.new.serialize(obj) elsif amf_version == 3 AMF::AMF3Serializer.new.serialize(obj) else raise AMFError, "unsupported version #{amf_version}" end end |