Class: Regin::Collection

### Home Classes Methods

### In Files

- lib/rack/mount/vendor/regin/regin/collection.rb

### Parent

Object

### Methods

- ::new
- #+
- #[]
- #each
- #extract_options
- #first
- #include?
- #last
- #length
- #match
- #size
- #to_regexp

### Included Modules

- Enumerable

### 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.

# Regin::Collection

### Public Class Methods

new(*args) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 5
    def initialize(*args)
      @array = Array.new(*args)
    end

### Public Instance Methods

+(other) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 30
    def +(other)
      ary = other.is_a?(self.class) ? other.internal_array : other
      self.class.new(@array + ary)
    end

[](i) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 13
    def [](i)
      @array[i]
    end

each() click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 9
    def each
      @array.each{ |item| yield item }
    end

first() click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 22
    def first
      @array.first
    end

include?(char) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 45
    def include?(char)
      any? { |e| e.include?(char) }
    end

last() click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 26
    def last
      @array.last
    end

length() click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 17
    def length
      @array.length
    end

Also aliased as: size
match(char) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 41
    def match(char)
      to_regexp.match(char)
    end

size() click to toggle source
Alias for: length
to_regexp(anchored = false) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 35
    def to_regexp(anchored = false)
      re = to_s(true)
      re = "\\A#{re}\\Z" if anchored
      Regexp.compile(re, flags)
    end

### Protected Instance Methods

extract_options(args) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/collection.rb, line 69
    def extract_options(args)
      if args.last.is_a?(Hash)
        return args[0..-2], args.last
      else
        return args, {}
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.