postman_mta 0.2.4 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63d6c39090e609521da139680163a8ea087177b08058fa9c891200ed74b2db24
4
- data.tar.gz: aad564e61a4c45ff2bbcfae4f1415acee51a0c5e064431974977a10fd2af4741
3
+ metadata.gz: ce5f34f0b7d6545969d804b0f436f005c88ac34b4701c275bd4a187adc30f289
4
+ data.tar.gz: 0136705aa5bcaba15afb6fbdbdc87f1286a1596a5182d430d15815dbda99e032
5
5
  SHA512:
6
- metadata.gz: f4c30c98c0a6baa305f4676965941e404b60421decf6ea2c71f5f934bf0c4bc597296955da11aa05caf67abc2315bdd4c95b8f9e7c2308be443d470ee3e7c6ec
7
- data.tar.gz: c03703cc5f1d59d2b0bde4aa848fdb7ea95366a9cdb9bc3049ff00c704bd2115d9893ae15641ea2e4d29178dfece718dcce1045ba6050b6820941470dce02caf
6
+ metadata.gz: 17c3bfff16a3b6bb6fed2a4d16757972124e7918c8291b244e3695a0e533dbc4298eb817d1eb7982dfc4e49697e1d2615f9c3c3cb32922cdd58f85e800cff649
7
+ data.tar.gz: 91f42bf727261fbdeb214af08f482c1038dc2bb91d8242f0f16e29863defa039965d8482fea25eb72e925efa93792b1908dd701dba0a11c46c1eb9bbb35a6ebe
@@ -0,0 +1,21 @@
1
+ module PostmanMta
2
+ class NotesController < ApplicationController
3
+ def create
4
+ render note.create(notes_params)
5
+ end
6
+
7
+ def update
8
+ render note.update(notes_params[:id], notes_params)
9
+ end
10
+
11
+ private
12
+
13
+ def note
14
+ @note ||= PostmanMta::Note.new
15
+ end
16
+
17
+ def notes_params
18
+ params.permit!
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,11 @@
1
+ module PostmanMta
2
+ class Note < ApplicationModel
3
+ def create(params)
4
+ post('/notes', body: params)
5
+ end
6
+
7
+ def update(note_id, params)
8
+ patch("/notes/#{note_id}", body: params)
9
+ end
10
+ end
11
+ end
data/config/routes.rb CHANGED
@@ -33,4 +33,5 @@ PostmanMta::Engine.routes.draw do
33
33
  resources :routes, only: :index
34
34
  resources :domains, only: :index
35
35
  resources :labels, only: :index
36
+ resources :notes, only: [:create, :update]
36
37
  end
@@ -17,7 +17,7 @@ module PostmanMta
17
17
  @response_body = response.parsed_response
18
18
  @response_status = response.code
19
19
 
20
- { json: response_body, status: response_status }
20
+ { json: response_body, status: @response_status }
21
21
  end
22
22
  end
23
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostmanMta
4
- VERSION = '0.2.4'
4
+ VERSION = '0.2.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postman_mta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Malinovskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2021-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -154,6 +154,7 @@ files:
154
154
  - app/controllers/postman_mta/domains_controller.rb
155
155
  - app/controllers/postman_mta/labels_controller.rb
156
156
  - app/controllers/postman_mta/messages_controller.rb
157
+ - app/controllers/postman_mta/notes_controller.rb
157
158
  - app/controllers/postman_mta/routes_controller.rb
158
159
  - app/controllers/postman_mta/stats/messages_controller.rb
159
160
  - app/controllers/postman_mta/tags_controller.rb
@@ -166,6 +167,7 @@ files:
166
167
  - app/models/postman_mta/domain.rb
167
168
  - app/models/postman_mta/label.rb
168
169
  - app/models/postman_mta/message.rb
170
+ - app/models/postman_mta/note.rb
169
171
  - app/models/postman_mta/route.rb
170
172
  - app/models/postman_mta/tag.rb
171
173
  - bin/console