Parent

Map::Struct

Constants

Keys

Attributes

map[R]

Public Class Methods

new(map) click to toggle source
# File lib/map/struct.rb, line 8
def initialize(map)
  @map = map
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
# File lib/map/struct.rb, line 12
def method_missing(method, *args, &block)
  method = method.to_s
  case method
    when /=$/
      key = method.chomp('=')
      value = args.shift
      @map[key] = value
    when /\?$/
      key = method.chomp('?')
      value = @map.has?( key )
    else
      key = method
      raise(IndexError, key) unless @map.has_key?(key)
      value = @map[key]
  end
  value.is_a?(Map) ? value.struct : value
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.