Class: TCellAgent::Instrumentation::Rails::TCellRoute

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

Direct Known Subclasses

TCellRoute4, TCellRoute5

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(route = nil) ⇒ TCellRoute

Returns a new instance of TCellRoute.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/tcell_agent/rails/routes.rb', line 14

def initialize(route = nil)
  @route = route

  @route_path_raw = nil
  @route_path = nil
  @route_destination = nil

  return unless route

  @route_path_raw = route.path.spec.to_s

  @route_path = @route_path_raw
  @route_path = @route_path_raw.chomp('(.:format)')

  @route_destination = nil
  @route_destination = JSON.dump(@route.defaults) if @route.defaults
end

Instance Attribute Details

#route_destinationObject (readonly)

Returns the value of attribute route_destination.



12
13
14
# File 'lib/tcell_agent/rails/routes.rb', line 12

def route_destination
  @route_destination
end

#route_idObject (readonly)

Returns the value of attribute route_id.



12
13
14
# File 'lib/tcell_agent/rails/routes.rb', line 12

def route_id
  @route_id
end

#route_pathObject (readonly)

Returns the value of attribute route_path.



12
13
14
# File 'lib/tcell_agent/rails/routes.rb', line 12

def route_path
  @route_path
end

#route_path_rawObject (readonly)

Returns the value of attribute route_path_raw.



12
13
14
# File 'lib/tcell_agent/rails/routes.rb', line 12

def route_path_raw
  @route_path_raw
end

Instance Method Details

#grape_route?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/tcell_agent/rails/routes.rb', line 40

def grape_route?
  TCellAgent::Instrumentation.grape_route?(@route)
end

#grape_routesObject



36
37
38
# File 'lib/tcell_agent/rails/routes.rb', line 36

def grape_routes
  []
end

#report?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/tcell_agent/rails/routes.rb', line 32

def report?
  false
end