Class: Regin::Alternation

### Home Classes Methods

### In Files

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

### Parent

Collection

### Methods

- ::new
- #dup
- #flags
- #literal?
- #to_s

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

No matching classes.

# Regin::Alternation

### Public Class Methods

new(*args) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/alternation.rb, line 3
    def initialize(*args)
      args, options = extract_options(args)

      if args.length == 1 && args.first.instance_of?(Array)
        super(args.first)
      else
        super(args)
      end

      if options.key?(:ignorecase)
        @array.map! { |e| e.dup(:ignorecase => options[:ignorecase]) }
      end
    end

### Public Instance Methods

dup(options = {}) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/alternation.rb, line 28
    def dup(options = {})
      self.class.new(to_a, options)
    end

flags() click to toggle source

    # File lib/rack/mount/vendor/regin/regin/alternation.rb, line 24
    def flags
      0
    end

literal?() click to toggle source

Returns true if expression could be treated as a literal string.

Alternation groups are never literal.

    # File lib/rack/mount/vendor/regin/regin/alternation.rb, line 20
    def literal?
      false
    end

to_s(parent = false) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/alternation.rb, line 32
    def to_s(parent = false)
      map { |e| e.to_s(parent) }.join('|')
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.