Class: TCellAgent::Instrumentation::Rails::TCellRoute4

Inherits:
TCellRoute
  • Object
show all
Defined in:
lib/tcell_agent/rails/routes.rb

Constant Summary collapse

METHODS =
%w[DELETE GET HEAD OPTIONS PATCH POST PUT TRACE CONNECT].freeze

Instance Attribute Summary

Attributes inherited from TCellRoute

#route_destination, #route_id, #route_path, #route_path_raw

Instance Method Summary collapse

Methods inherited from TCellRoute

#grape_route?, #initialize

Constructor Details

This class inherits a constructor from TCellAgent::Instrumentation::Rails::TCellRoute

Instance Method Details

#grape_routesObject



70
71
72
73
74
75
76
# File 'lib/tcell_agent/rails/routes.rb', line 70

def grape_routes
  if ::Rails::VERSION::MAJOR == 4 && ::Rails::VERSION::MINOR < 2
    @route.app.routes
  else
    @route.app.app.routes
  end
end

#report?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/tcell_agent/rails/routes.rb', line 62

def report?
  @route.constraints.key?(:request_method) || grape_route?
end

#route_methodsObject



66
67
68
# File 'lib/tcell_agent/rails/routes.rb', line 66

def route_methods
  METHODS.select { |x| @route.verb.match(x) }
end