Class: Rails::Openapi::Endpoint
- Inherits:
-
Struct
- Object
- Struct
- Rails::Openapi::Endpoint
- Defined in:
- lib/rails/openapi/router.rb
Overview
Internally represents individual routes
Instance Attribute Summary collapse
-
#_path ⇒ Object
Returns the value of attribute _path.
-
#definition ⇒ Object
Returns the value of attribute definition.
-
#method ⇒ Object
Returns the value of attribute method.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(*opts) ⇒ Endpoint
constructor
A new instance of Endpoint.
-
#path ⇒ Object
Translates path params from bracket syntax to :symbol syntax.
Constructor Details
#initialize(*opts) ⇒ Endpoint
Returns a new instance of Endpoint.
5 6 7 8 |
# File 'lib/rails/openapi/router.rb', line 5 def initialize *opts super self[:_path] = path end |
Instance Attribute Details
#_path ⇒ Object
Returns the value of attribute _path
4 5 6 |
# File 'lib/rails/openapi/router.rb', line 4 def _path @_path end |
#definition ⇒ Object
Returns the value of attribute definition
4 5 6 |
# File 'lib/rails/openapi/router.rb', line 4 def definition @definition end |
#method ⇒ Object
Returns the value of attribute method
4 5 6 |
# File 'lib/rails/openapi/router.rb', line 4 def method @method end |
#url ⇒ Object
Returns the value of attribute url
4 5 6 |
# File 'lib/rails/openapi/router.rb', line 4 def url @url end |
Instance Method Details
#path ⇒ Object
Translates path params from bracket syntax to :symbol syntax
11 12 13 |
# File 'lib/rails/openapi/router.rb', line 11 def path self[:url].gsub(/\{([^}]+)\}/, ':\\1') end |