Class: Kong::Plugin
- Inherits:
-
Object
- Object
- Kong::Plugin
- Includes:
- Base, BelongsToApi
- Defined in:
- lib/kong/plugin.rb
Constant Summary collapse
- ATTRIBUTE_NAMES =
%w(id api_id name config enabled consumer_id).freeze
- API_END_POINT =
'/plugins/'.freeze
Instance Attribute Summary
Attributes included from BelongsToApi
Attributes included from Base
Instance Method Summary collapse
-
#create ⇒ Object
Create resource.
-
#update ⇒ Object
update resource.
Methods included from BelongsToApi
Methods included from Base
#client, #create_or_update, #delete, #get, included, #initialize, #method_missing, #new?, #respond_to?, #save
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Kong::Base
Instance Method Details
#create ⇒ Object
Create resource
10 11 12 13 14 15 16 17 18 |
# File 'lib/kong/plugin.rb', line 10 def create if attributes['config'] attributes['config'].each do |key, value| attributes["config.#{key}"] = value end attributes.delete('config') end super end |
#update ⇒ Object
update resource
21 22 23 24 25 26 27 28 29 |
# File 'lib/kong/plugin.rb', line 21 def update if attributes['config'] attributes['config'].each do |key, value| attributes["config.#{key}"] = value end attributes.delete('config') end super end |