Class: Regin::Options

### Home Classes Methods

### In Files

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

### Parent

Object

### Methods

- ::from_int
- ::new
- #any?
- #to_h
- #to_i

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

### Attributes

extended[R]
ignorecase[R]
multiline[R]

### Public Class Methods

from_int(flags) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/options.rb, line 3
    def self.from_int(flags)
      multiline  = flags & Regexp::MULTILINE != 0
      ignorecase = flags & Regexp::IGNORECASE != 0
      extended   = flags & Regexp::EXTENDED != 0

      new(multiline, ignorecase, extended)
    end

new(*args) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/options.rb, line 13
    def initialize(*args)
      if args.first.is_a?(Hash)
        @multiline  = args[0][:multiline]
        @ignorecase = args[0][:ignorecase]
        @extended   = args[0][:extended]
      else
        @multiline  = args[0]
        @ignorecase = args[1]
        @extended   = args[2]
      end
    end

### Public Instance Methods

any?(explicit = false) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/options.rb, line 25
    def any?(explicit = false)
      if explicit
        !multiline.nil? || !ignorecase.nil? || !extended.nil?
      else
        multiline || ignorecase || extended
      end
    end

to_h(explicit = false) click to toggle source

    # File lib/rack/mount/vendor/regin/regin/options.rb, line 33
    def to_h(explicit = false)
      if explicit
        options = {}
        options[:multiline]  = multiline  unless multiline.nil?
        options[:ignorecase] = ignorecase unless ignorecase.nil?
        options[:extended]   = extended   unless extended.nil?
        options
      else
        { :multiline => multiline,
          :ignorecase => ignorecase,
          :extended => extended }
      end
    end

to_i() click to toggle source

    # File lib/rack/mount/vendor/regin/regin/options.rb, line 47
    def to_i
      flag = 0
      flag |= Regexp::MULTILINE if multiline
      flag |= Regexp::IGNORECASE if ignorecase
      flag |= Regexp::EXTENDED if extended
      flag
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.