Class: AMF::MappingSet

Inherits:
Object
  • Object
show all
Defined in:
lib/amf/pure/mapping/mapping_set.rb

Overview

Container for all mapped classes

Instance Method Summary collapse

Constructor Details

#initializeMappingSet

Returns a new instance of MappingSet.



12
13
14
15
# File 'lib/amf/pure/mapping/mapping_set.rb', line 12

def initialize
  @mappings_remote = {}
  @mappings_local  = {}
end

Instance Method Details

#get_class_name_local(class_name_remote) ⇒ Object

:nodoc:



37
38
39
# File 'lib/amf/pure/mapping/mapping_set.rb', line 37

def get_class_name_local(class_name_remote) #:nodoc:
  @mappings_remote[class_name_remote.to_s]
end

#get_class_name_remote(class_name_local) ⇒ Object

:nodoc:



44
45
46
# File 'lib/amf/pure/mapping/mapping_set.rb', line 44

def get_class_name_remote(class_name_local) #:nodoc:
  @mappings_local[class_name_local.to_s]
end

#register_class_alias(class_local, class_remote) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/amf/pure/mapping/mapping_set.rb', line 25

def register_class_alias(class_local, class_remote)
  # Convert params to strings
  class_remote = class_remote.to_s
  class_local  = class_local.to_s

  @mappings_remote[class_remote] = class_local
  @mappings_local[class_local]   = class_remote
end