Class: Rack::Mount::Analysis::Splitting::Key

### Home Classes Methods

### In Files

- lib/rack/mount/analysis/splitting.rb

### Parent

Struct.new(:method, :index, :separators)

### Methods

- ::split
- #call
- #call_source
- #inspect

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- Rack
- Rack::Mount
- Rack::Mount::Analysis
- Rack::Mount::Analysis::Splitting
- Rack::Mount::Analysis::Splitting::Key
- Rack::Mount::GeneratableRegexp
- Rack::Mount::GeneratableRegexp::InstanceMethods
- Rack::Mount::RegexpWithNamedGroups
- Rack::Mount::Route
- Rack::Mount::RouteSet
- Rack::Mount::RoutingError
- Rack::Mount::Strexp
- Rack::Mount::StrexpParser
- Rack::Mount::StrexpParser::ScanError
- Rack::Mount::Utils
- Regin
- Regin::Alternation
- Regin::Anchor
- Regin::Atom
- Regin::Character
- Regin::CharacterClass
- Regin::Collection
- Regin::Expression
- Regin::Group
- Regin::Options
- Regin::Parser
- Regin::Parser::ScanError
- Multimap
- Multiset
- NestedMultimap

No matching classes.

# Rack::Mount::Analysis::Splitting::Key

### Public Class Methods

split(value, separator_pattern) click to toggle source

    # File lib/rack/mount/analysis/splitting.rb, line 9
    def self.split(value, separator_pattern)
      keys = value.split(separator_pattern)
      keys.shift if keys[0] == ''
      keys << NULL
      keys
    end

### Public Instance Methods

call(cache, obj) click to toggle source

    # File lib/rack/mount/analysis/splitting.rb, line 16
    def call(cache, obj)
      (cache[method] ||= self.class.split(obj.send(method), separators))[index]
    end

call_source(cache, obj) click to toggle source

    # File lib/rack/mount/analysis/splitting.rb, line 20
    def call_source(cache, obj)
      "(#{cache}[:#{method}] ||= Analysis::Splitting::Key.split(#{obj}.#{method}, #{separators.inspect}))[#{index}]"
    end

inspect() click to toggle source

    # File lib/rack/mount/analysis/splitting.rb, line 24
    def inspect
      "#{method}[#{index}].split(#{separators.inspect})"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.