Parent

Innate::URLMap

Public Class Methods

new(map = {}) click to toggle source
   # File lib/innate/dynamap.rb, line 3
3:     def initialize(map = {})
4:       @originals = map
5:       super
6:     end

Public Instance Methods

at(location) click to toggle source
    # File lib/innate/dynamap.rb, line 26
26:     def at(location)
27:       @originals[location]
28:     end
call(env) click to toggle source
    # File lib/innate/dynamap.rb, line 38
38:     def call(env)
39:       raise "Nothing mapped yet" if @originals.empty?
40:       super
41:     end
delete(location) click to toggle source
    # File lib/innate/dynamap.rb, line 21
21:     def delete(location)
22:       @originals.delete(location)
23:       remap(@originals)
24:     end
map(location, object) click to toggle source
    # File lib/innate/dynamap.rb, line 16
16:     def map(location, object)
17:       return unless location and object
18:       remap(@originals.merge(location.to_s => object))
19:     end
remap(map) click to toggle source

super may raise when given invalid locations, so we only replace the `@originals` if we are sure the new map is valid

    # File lib/innate/dynamap.rb, line 10
10:     def remap(map)
11:       value = super
12:       @originals = map
13:       value
14:     end
to(object) click to toggle source
    # File lib/innate/dynamap.rb, line 30
30:     def to(object)
31:       @originals.invert[object]
32:     end
to_hash() click to toggle source
    # File lib/innate/dynamap.rb, line 34
34:     def to_hash
35:       @originals.dup
36:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.