# File lib/hammer_cli_import/persistentmap.rb, line 69 def persistent_map(symbol) defs = PersistentMap.definitions raise PersistentMapError, "Unknown persistent map: #{symbol}" unless defs.key? symbol # Names of persistent maps @maps ||= [] @maps.push symbol key_spec, val_spec, target_entity = defs[symbol] # Which entities they are mapped to? # Usually they are mapped to the same entities on Sat6 (speaking of api) # But sometimes you need to create same type of Sat6 entities based on # different Sat5 entities, and then it is time for this extra option. @map_target_entity ||= {} @map_target_entity[symbol] = target_entity # How keys and values looks like (so they can be nicely stored) @map_description ||= {} @map_description[symbol] = [key_spec, val_spec] end