Class: Innate::URLMap

### Home Classes Methods

### In Files

- lib/innate/dynamap.rb

### Parent

Rack::URLMap

### Methods

- ::new
- #at
- #call
- #delete
- #map
- #remap
- #to
- #to_hash

### Class/Module Index

Quicksearch

- Innate
- Innate::Action
- Innate::Adapter
- Innate::Cache
- Innate::Cache::API
- Innate::Cache::DRb
- Innate::Cache::FileBased
- Innate::Cache::Marshal
- Innate::Cache::Memory
- Innate::Cache::YAML
- Innate::Current
- Innate::Etanni
- Innate::Helper
- Innate::Helper::Aspect
- Innate::Helper::Aspect::SingletonMethods
- Innate::Helper::CGI
- Innate::Helper::Flash
- Innate::Helper::Link
- Innate::Helper::Redirect
- Innate::Helper::Render
- Innate::HelperAccess
- Innate::HelpersHelper
- Innate::LRUHash
- Innate::LogHub
- Innate::Mock
- Innate::Mock::Session
- Innate::Node
- Innate::Optioned
- Innate::Optioned::SingletonMethods
- Innate::Options
- Innate::Request
- Innate::Response
- Innate::Rewrite
- Innate::Route
- Innate::Session
- Innate::Session::Flash
- Innate::SingletonMethods
- Innate::StateAccessor
- Innate::Traited
- Innate::Trinity
- Innate::URLMap
- Innate::View
- Innate::View::ERB
- Innate::View::Etanni
- Innate::View::None
- Logger
- Logger::ColorFormatter
- Object

No matching classes.

# Innate::URLMap

### Public Class Methods

new(map = {}) click to toggle source

    # File lib/innate/dynamap.rb, line 3
    def initialize(map = {})
      @originals = map
      super
    end

### Public Instance Methods

at(location) click to toggle source

    # File lib/innate/dynamap.rb, line 26
    def at(location)
      @originals[location]
    end

call(env) click to toggle source

    # File lib/innate/dynamap.rb, line 38
    def call(env)
      raise "Nothing mapped yet" if @originals.empty?
      super
    end

delete(location) click to toggle source

    # File lib/innate/dynamap.rb, line 21
    def delete(location)
      @originals.delete(location)
      remap(@originals)
    end

map(location, object) click to toggle source

    # File lib/innate/dynamap.rb, line 16
    def map(location, object)
      return unless location and object
      remap(@originals.merge(location.to_s => object))
    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
    def remap(map)
      value = super
      @originals = map
      value
    end

to(object) click to toggle source

    # File lib/innate/dynamap.rb, line 30
    def to(object)
      @originals.invert[object]
    end

to_hash() click to toggle source

    # File lib/innate/dynamap.rb, line 34
    def to_hash
      @originals.dup
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.