Class: TCellAgent::Instrumentation::Rails::TCellRoute
- Inherits:
-
Object
- Object
- TCellAgent::Instrumentation::Rails::TCellRoute
- Defined in:
- lib/tcell_agent/rails/routes.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#route_destination ⇒ Object
readonly
Returns the value of attribute route_destination.
-
#route_id ⇒ Object
readonly
Returns the value of attribute route_id.
-
#route_path ⇒ Object
readonly
Returns the value of attribute route_path.
-
#route_path_raw ⇒ Object
readonly
Returns the value of attribute route_path_raw.
Instance Method Summary collapse
- #grape_route? ⇒ Boolean
- #grape_routes ⇒ Object
-
#initialize(route = nil) ⇒ TCellRoute
constructor
A new instance of TCellRoute.
- #report? ⇒ Boolean
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_destination ⇒ Object (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_id ⇒ Object (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_path ⇒ Object (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_raw ⇒ Object (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
40 41 42 |
# File 'lib/tcell_agent/rails/routes.rb', line 40 def grape_route? TCellAgent::Instrumentation.grape_route?(@route) end |
#grape_routes ⇒ Object
36 37 38 |
# File 'lib/tcell_agent/rails/routes.rb', line 36 def grape_routes [] end |
#report? ⇒ Boolean
32 33 34 |
# File 'lib/tcell_agent/rails/routes.rb', line 32 def report? false end |