Class: Kongrations::CreatePluginResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/kongrations/responses/create_plugin_response.rb

Instance Method Summary collapse

Methods inherited from Response

#body, #error?, #initialize, #save_data, #success?

Constructor Details

This class inherits a constructor from Kongrations::Response

Instance Method Details

#data_to_saveObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/kongrations/responses/create_plugin_response.rb', line 7

def data_to_save
  api_name = @request.api_name
  plugin_name = @request.payload[:name]
  plugin_id = body[:id]
  {
    'apis' => {
      api_name => {
        'plugins' => {
          plugin_name => plugin_id
        }
      }
    }
  }
end