class ActionDispatch::Routing::RouteWrapper - actionpack-4.2.3 Documentation

# class ActionDispatch::Routing::RouteWrapper

### Public Instance Methods

action() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 60
    def action
      requirements[:action] || ':action'
    end

constraints() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 11
    def constraints
      requirements.except(:controller, :action)
    end

controller() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 56
    def controller
      requirements[:controller] || ':controller'
    end

endpoint() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 7
    def endpoint
      app.dispatcher? ? "#{controller}##{action}" : rack_app.inspect
    end

engine?() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 68
    def engine?
      rack_app.respond_to?(:routes)
    end

internal?() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 64
    def internal?
      controller.to_s =~ %r{\Arails/(info|mailers|welcome)} || path =~ %r{\A#{Rails.application.config.assets.prefix}\z}
    end

json_regexp() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 35
    def json_regexp
      str = regexp.inspect.
            sub('\A' , '^').
            sub('\Z' , '$').
            sub('\z' , '$').
            sub(/^\// , '').
            sub(/\/[a-z]*$/ , '').
            gsub(/\(\?#.+\)/ , '').
            gsub(/\(\?-\w+:/ , '(').
            gsub(/\s/ , '')
      Regexp.new(str).source
    end

name() click to toggle source
Calls superclass method

    # File lib/action_dispatch/routing/inspector.rb, line 27
    def name
      super.to_s
    end

path() click to toggle source
Calls superclass method

    # File lib/action_dispatch/routing/inspector.rb, line 23
    def path
      super.spec.to_s
    end

rack_app() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 15
    def rack_app
      app.app
    end

regexp() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 31
    def regexp
      __getobj__.path.to_regexp
    end

reqs() click to toggle source

    # File lib/action_dispatch/routing/inspector.rb, line 48
    def reqs
      @reqs ||= begin
        reqs = endpoint
        reqs += " #{constraints}" unless constraints.empty?
        reqs
      end
    end

verb() click to toggle source
Calls superclass method

    # File lib/action_dispatch/routing/inspector.rb, line 19
    def verb
      super.source.gsub(/[$^]/, '')
    end