Class: ActionDispatch::Routing::Mapper::Mapping

Inherits:
Object
  • Object
show all
Defined in:
actionpack/lib/action_dispatch/routing/mapper.rb

Overview

:nodoc:

Constant Summary collapse

IGNORE_OPTIONS =
[:to, :as, :via, :on, :constraints, :defaults, :only, :except, :anchor, :shallow, :shallow_path, :shallow_prefix, :format]
ANCHOR_CHARACTERS_REGEX =
%r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
WILDCARD_PATH =
%r{\*([^/\)]+)\)?$}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(set, scope, path, options) ⇒ Mapping

Returns a new instance of Mapping.



61
62
63
64
65
66
67
68
69
70
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 61

def initialize(set, scope, path, options)
  @set, @scope, @path, @options = set, scope, path, options
  @requirements, @conditions, @defaults = {}, {}, {}

  normalize_options!
  normalize_path!
  normalize_requirements!
  normalize_conditions!
  normalize_defaults!
end

Instance Attribute Details

#conditionsObject (readonly)

Returns the value of attribute conditions



59
60
61
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 59

def conditions
  @conditions
end

#defaultsObject (readonly)

Returns the value of attribute defaults



59
60
61
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 59

def defaults
  @defaults
end

#optionsObject (readonly)

Returns the value of attribute options



59
60
61
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 59

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path



59
60
61
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 59

def path
  @path
end

#requirementsObject (readonly)

Returns the value of attribute requirements



59
60
61
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 59

def requirements
  @requirements
end

#scopeObject (readonly)

Returns the value of attribute scope



59
60
61
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 59

def scope
  @scope
end

Instance Method Details

#to_routeObject



72
73
74
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 72

def to_route
  [ app, conditions, requirements, defaults, options[:as], options[:anchor] ]
end