Return default ActionScript prefix to use. This is recommended compared to defining mappings manually
# File lib/restfulx/amf/class_mapping.rb, line 69 def default_as_prefix mappings.default_as_prefix end
Set the default ActionScript prefix (typically a package e.g. com.foobar) to use for all models
# File lib/restfulx/amf/class_mapping.rb, line 75 def default_as_prefix=(value) mappings.default_as_prefix = value end
Define class mappings in the block. Block is passed a MappingSet object as the first parameter.
Example:
RestfulX::AMF::ClassMapper.define do |m| m.map :as => 'AsClass', :ruby => 'RubyClass' end
# File lib/restfulx/amf/class_mapping.rb, line 63 def define #:yields: mapping_set yield mappings end
Returns the AS class name for the given ruby object. Will also take a string containing the ruby class name
# File lib/restfulx/amf/class_mapping.rb, line 81 def get_as_class_name(obj) # Get class name if obj.is_a?(String) ruby_class_name = obj else ruby_class_name = obj.class.name end if obj.respond_to?(:unique_id) mappings.get_as_class_name(ruby_class_name) else nil end end
Return ruby model class name for a given ActionScript model class name
# File lib/restfulx/amf/class_mapping.rb, line 97 def get_ruby_class_name(as_class_name) mappings.get_ruby_class_name(as_class_name.to_s) end