Module: RubyAMF

Defined in:
lib/rubyamf.rb,
lib/rubyamf/test.rb,
lib/rubyamf/fault.rb,
lib/rubyamf/model.rb,
lib/rubyamf/logger.rb,
lib/rubyamf/version.rb,
lib/rubyamf/envelope.rb,
lib/rubyamf/class_mapping.rb,
lib/rubyamf/configuration.rb,
lib/rubyamf/request_parser.rb,
lib/rubyamf/intermediate_object.rb,
lib/rubyamf/rails/rails2_bootstrap.rb

Defined Under Namespace

Modules: LegacySandbox, Model, Rails, Test Classes: ClassMapping, Configuration, Envelope, Fault, IntermediateObject, Logger, MappingSet, Railtie, RequestParser

Constant Summary collapse

MIME_TYPE =
"application/x-amf".freeze
VERSION =
"2.0.0"

Class Method Summary collapse

Class Method Details

.bootstrapObject



36
37
38
39
# File 'lib/rubyamf.rb', line 36

def bootstrap
  configuration.preload_models.flatten.each {|m| m.to_s.constantize}
  RubyAMF::ClassMapper.use_array_collection = configuration.use_array_collection # Make sure it gets copied over for RocketAMF
end

.configurationObject



19
20
21
# File 'lib/rubyamf.rb', line 19

def configuration
  @configuration ||= RubyAMF::Configuration.new
end

.configuration=(config) ⇒ Object



23
24
25
# File 'lib/rubyamf.rb', line 23

def configuration= config
  @configuration = config
end

.configure {|configuration| ... } ⇒ Object

Yields:



31
32
33
34
# File 'lib/rubyamf.rb', line 31

def configure
  yield configuration
  bootstrap
end

.const_missing(const) ⇒ Object

:nodoc:



41
42
43
44
45
46
47
48
49
# File 'lib/rubyamf.rb', line 41

def const_missing const #:nodoc:
  if const == :ClassMapper
    class_mapper = configuration.class_mapper
    RubyAMF.const_set(:ClassMapper, class_mapper)
    RocketAMF.const_set(:ClassMapper, class_mapper)
  else
    super(const)
  end
end

.loggerObject



27
28
29
# File 'lib/rubyamf.rb', line 27

def logger
  @logger ||= RubyAMF::Logger.new
end