class Xumlidot::Diagram::Xmi::NamespaceToId

We need to keep track of the ids assigned in the body for each class.

Public Class Methods

new() click to toggle source
# File lib/xumlidot/diagram/xmi.rb, line 73
def initialize
  @namespace_to_id = {}
  @id_to_namespace = {}
end

Public Instance Methods

[](name) click to toggle source
# File lib/xumlidot/diagram/xmi.rb, line 87
def [](name)
  @namespace_to_id[name]
end
[]=(name, id) click to toggle source
# File lib/xumlidot/diagram/xmi.rb, line 91
def []=(name, id)
  @namespace_to_id[name] = id
  @id_to_namespace[id] = name
end
has?(full_namespace) click to toggle source
# File lib/xumlidot/diagram/xmi.rb, line 83
def has?(full_namespace)
  @namespace_to_id[full_namespace] != nil
end
has_value?(id) click to toggle source

reverse lookup

# File lib/xumlidot/diagram/xmi.rb, line 79
def has_value?(id)
  @id_to_namespace[id] != nil
end