Method: ActionDispatch::Routing::Mapper::Constraints#initialize

Defined in:
lib/action_dispatch/routing/mapper.rb

#initialize(app, constraints, strategy) ⇒ Constraints

Returns a new instance of Constraints.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/action_dispatch/routing/mapper.rb', line 35

def initialize(app, constraints, strategy)
  # Unwrap Constraints objects. I don't actually think it's possible to pass a
  # Constraints object to this constructor, but there were multiple places that
  # kept testing children of this object. I **think** they were just being
  # defensive, but I have no idea.
  if app.is_a?(self.class)
    constraints += app.constraints
    app = app.app
  end

  @strategy = strategy

  @app, @constraints, = app, constraints
end