class Inspector::Metadata::Map

Public Class Methods

new() click to toggle source
# File lib/inspector/metadata/map.rb, line 4
def initialize
  @map = {}
end

Public Instance Methods

[](type) click to toggle source
# File lib/inspector/metadata/map.rb, line 16
def [](type)
  @map.fetch(type)
rescue KeyError
  raise "validation information for #{type.inspect} doesn't exist, use " +
        "Inspector.valid(#{type.inspect}) to define it"
end
[]=(type, metadata) click to toggle source
# File lib/inspector/metadata/map.rb, line 8
def []=(type, metadata)
  unless metadata.kind_of?(Metadata)
    raise "#{metadata.inspect} is not a Inspector::Metadata"
  end

  @map[type] = metadata
end