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

Inherits:
Object
  • Object
show all
Defined in:
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.



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

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.



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

def conditions
  @conditions
end

#defaultsObject (readonly)

Returns the value of attribute defaults.



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

def defaults
  @defaults
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#requirementsObject (readonly)

Returns the value of attribute requirements.



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

def requirements
  @requirements
end

#scopeObject (readonly)

Returns the value of attribute scope.



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

def scope
  @scope
end

Instance Method Details

#to_routeObject



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

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