Module: Kong::BelongsToApi
- Included in:
- Plugin
- Defined in:
- lib/kong/belongs_to_api.rb
Instance Attribute Summary collapse
-
#api ⇒ Kong::Api
Get Api resource.
Instance Method Summary collapse
-
#api_id=(id) ⇒ Object
Set Api id.
-
#use_api_end_point ⇒ Object
Convert API end point relative to Kong API resource.
Instance Attribute Details
#api ⇒ Kong::Api
Get Api resource
12 13 14 |
# File 'lib/kong/belongs_to_api.rb', line 12 def api @api end |
Instance Method Details
#api_id=(id) ⇒ Object
Set Api id
25 26 27 28 |
# File 'lib/kong/belongs_to_api.rb', line 25 def api_id=(id) super(id) use_api_end_point end |
#use_api_end_point ⇒ Object
Convert API end point relative to Kong API resource
6 7 8 |
# File 'lib/kong/belongs_to_api.rb', line 6 def use_api_end_point self.api_end_point = "/apis/#{self.api_id}#{self.class::API_END_POINT}" if self.api_id end |