pseng_ekg_client 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 0423beb157b28a73c044f5c5f119729b528d08dc
4
- data.tar.gz: ba7009afca7ac998722eb9d5edcd3a207ae655ed
3
+ metadata.gz: 0527eac89cb61adcd6719c0c82d68162ea724a82
4
+ data.tar.gz: 1e399d6f98aaee47363b06790d13f71a5168c8be
5
5
  SHA512:
6
- metadata.gz: 49def8f76fd7b67b9d27bc209e9af68cf6df305f0361a782108ef85f1df3ac0d9621074bc5e2b7002c2463e1f27fc6be635d9329fa6508a2ff7072c632d01ea9
7
- data.tar.gz: c1f9581ac1383312ddb47d6b3d3a49063c40471169db3f2e2438724be1557abd0271477fa8017de036148b89963f7f10945e87a76b09fd37d0e8fb6a0fe010bb
6
+ metadata.gz: 4a45334104ab04d6d5cfabcfbc04df4881e982e9d6d64d91e12078bd0d9731bb49e88b9d067db25bd87b2a5d775373a55d791a1eed5a7e0996ee7902d9c4afce
7
+ data.tar.gz: 196bdb65307731024a9aef609e1dea56591f6c33abed1723b1b175286767d16ba05006907c7910a1e6a24132d7c16cd3740d787c9821442df4709c43baed8dbd
@@ -1,3 +1,3 @@
1
1
  module PsengEkgClient
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,29 +1,31 @@
1
1
  require "pseng_ekg_client/version"
2
2
 
3
- class PsengEkgClient
4
- include HTTParty
5
- VALID_ACTIONS = %w(index show create update destroy)
6
- VALID_RECORD_TYPES = %w(application task)
3
+ module PsengEkgClient
4
+ class Api
5
+ include HTTParty
6
+ VALID_ACTIONS = %w(index show create update destroy)
7
+ VALID_RECORD_TYPES = %w(application task)
7
8
 
8
- def initialize(base_uri)
9
- self.base_uri base_uri
10
- end
9
+ def initialize(base_uri)
10
+ self.base_uri base_uri
11
+ end
11
12
 
12
- def send_message(record_type, action, payload)
13
- raise 'Invalid Action' unless VALID_ACTIONS.include?(action)
14
- raise 'Invalid Record Type' unless VALID_RECORD_TYPES.include?(action)
13
+ def send_message(record_type, action, payload)
14
+ raise 'Invalid Action' unless VALID_ACTIONS.include?(action)
15
+ raise 'Invalid Record Type' unless VALID_RECORD_TYPES.include?(action)
15
16
 
16
- case action
17
- when 'index'
18
- self.class.get("/#{record_type}s.json", payload)
19
- when 'show'
20
- self.class.get("/#{record_type}s/#{payload.id}.json", payload)
21
- when 'create'
22
- self.class.post("/#{record_type}s.json", payload)
23
- when 'update'
24
- self.class.patch("/#{record_type}s/#{payload.id}.json", payload)
25
- when 'destroy'
26
- self.class.delete("/#{record_type}s/#{payload.id}.json", payload)
17
+ case action
18
+ when 'index'
19
+ self.class.get("/#{record_type}s.json", payload)
20
+ when 'show'
21
+ self.class.get("/#{record_type}s/#{payload.id}.json", payload)
22
+ when 'create'
23
+ self.class.post("/#{record_type}s.json", payload)
24
+ when 'update'
25
+ self.class.patch("/#{record_type}s/#{payload.id}.json", payload)
26
+ when 'destroy'
27
+ self.class.delete("/#{record_type}s/#{payload.id}.json", payload)
28
+ end
27
29
  end
28
30
  end
29
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pseng_ekg_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Tanner