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.



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

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.



10
11
12
# File 'lib/tcell_agent/rails/routes.rb', line 10

def route_destination
  @route_destination
end

#route_idObject (readonly)

Returns the value of attribute route_id.



10
11
12
# File 'lib/tcell_agent/rails/routes.rb', line 10

def route_id
  @route_id
end

#route_pathObject (readonly)

Returns the value of attribute route_path.



10
11
12
# File 'lib/tcell_agent/rails/routes.rb', line 10

def route_path
  @route_path
end

#route_path_rawObject (readonly)

Returns the value of attribute route_path_raw.



10
11
12
# File 'lib/tcell_agent/rails/routes.rb', line 10

def route_path_raw
  @route_path_raw
end

Instance Method Details

#grape_route?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/tcell_agent/rails/routes.rb', line 38

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

#grape_routesObject



34
35
36
# File 'lib/tcell_agent/rails/routes.rb', line 34

def grape_routes
  []
end

#report?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/tcell_agent/rails/routes.rb', line 30

def report?
  false
end