pseng_ekg_client 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pseng_ekg/client/applications.rb +27 -0
- data/lib/pseng_ekg/client/tasks.rb +27 -0
- data/lib/pseng_ekg/version.rb +3 -0
- data/lib/pseng_ekg_client.rb +7 -29
- data/pseng_ekg_client.gemspec +2 -2
- metadata +4 -2
- data/lib/pseng_ekg_client/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8c7d56874c7eff8d5a0c71f96b19602ed7e3a27
|
4
|
+
data.tar.gz: e3abb54cfc6776b9ee1a4c77387eb20cf993832d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce7f1ce57c9c6769fbffc1d5dc06e45c3a4f9c7b6cf18b885f3c2ac8cd41bd12a7908042f31ea54fb08ad63c9118dc913f3c2f7d5c5d7769923a287e235f7160
|
7
|
+
data.tar.gz: d675731e0a1cd0aff0c6ff37c1f83165b90d52d93c0c287f9b04190960662a74ed402e2b3085f0954c66f2a44edcc5c8b579fb07f6bc609d1bdb19c6d6b9d8d3
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module PsengEkg
|
2
|
+
class Client
|
3
|
+
module Applications
|
4
|
+
|
5
|
+
def application_index(options = {})
|
6
|
+
self.class.get("/api/v1/applications.json", options)
|
7
|
+
end
|
8
|
+
|
9
|
+
def application_show(application_id, options = {})
|
10
|
+
self.class.get("/api/v1/applications/#{application_id}.json", options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def application_create(options = {})
|
14
|
+
self.class.post("/api/v1/applications.json", options)
|
15
|
+
end
|
16
|
+
|
17
|
+
def application_update(applictation_id, options = {})
|
18
|
+
self.class.patch("/api/v1/applications/#{application_id}.json", options)
|
19
|
+
end
|
20
|
+
|
21
|
+
def application_destroy(applictation_id, options = {})
|
22
|
+
self.class.destroy("/api/v1/applications.json", options)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module PsengEkg
|
2
|
+
class Client
|
3
|
+
module Tasks
|
4
|
+
|
5
|
+
def task_index(application_id, options = {})
|
6
|
+
self.class.get("/api/v1/applications/#{application_id}/tasks.json", options)
|
7
|
+
end
|
8
|
+
|
9
|
+
def task_show(application_id, task_id, options = {})
|
10
|
+
self.class.get("/api/v1/applications/#{application_id}/tasks/#{task_id}.json", options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def task_create(application_id, options = {})
|
14
|
+
self.class.post("/api/v1/applications/#{application_id}/tasks.json", options)
|
15
|
+
end
|
16
|
+
|
17
|
+
def task_update(applictation_id, task_id, options = {})
|
18
|
+
self.class.patch("/api/v1/applications/#{application_id}/tasks/#{task_id}.json", options)
|
19
|
+
end
|
20
|
+
|
21
|
+
def task_destroy(applictation_id, task_id, options = {})
|
22
|
+
self.class.destroy("/api/v1/applications/#{application_id}/tasks/#{task_id}.json", options)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/pseng_ekg_client.rb
CHANGED
@@ -1,38 +1,16 @@
|
|
1
|
-
require "
|
1
|
+
require "pseng_ekg/version"
|
2
|
+
require "pseng_ekg/client/applications"
|
3
|
+
require "pseng_ekg/client/tasks"
|
2
4
|
require 'httparty'
|
3
5
|
|
4
|
-
module
|
5
|
-
class
|
6
|
+
module PsengEkg
|
7
|
+
class Client
|
6
8
|
include HTTParty
|
7
|
-
|
8
|
-
|
9
|
+
include Applications
|
10
|
+
include Tasks
|
9
11
|
|
10
12
|
def initialize(base_uri)
|
11
13
|
self.class.base_uri base_uri
|
12
14
|
end
|
13
|
-
|
14
|
-
def send_message(record_type, action, payload, id = nil)
|
15
|
-
raise 'Invalid Action' unless VALID_ACTIONS.include?(action)
|
16
|
-
raise 'Invalid Record Type' unless VALID_RECORD_TYPES.include?(record_type)
|
17
|
-
|
18
|
-
options = {
|
19
|
-
body: payload.to_json,
|
20
|
-
headers: { 'Content-Type' => 'application/json' }
|
21
|
-
}
|
22
|
-
|
23
|
-
response = case action
|
24
|
-
when 'index'
|
25
|
-
self.class.get("/#{record_type}s.json", options)
|
26
|
-
when 'show'
|
27
|
-
self.class.get("/#{record_type}s/#{id}.json", options)
|
28
|
-
when 'create'
|
29
|
-
self.class.post("/#{record_type}s.json", options)
|
30
|
-
when 'update'
|
31
|
-
self.class.patch("/#{record_type}s/#{id}.json", options)
|
32
|
-
when 'destroy'
|
33
|
-
self.class.delete("/#{record_type}s/#{id}.json", options)
|
34
|
-
end
|
35
|
-
response
|
36
|
-
end
|
37
15
|
end
|
38
16
|
end
|
data/pseng_ekg_client.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require 'pseng_ekg/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "pseng_ekg_client"
|
8
|
-
spec.version =
|
8
|
+
spec.version = PsengEkg::VERSION
|
9
9
|
spec.authors = ["Cody Tanner"]
|
10
10
|
spec.email = ["ctanner@instructure.com"]
|
11
11
|
|
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.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Tanner
|
@@ -75,8 +75,10 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- Rakefile
|
78
|
+
- lib/pseng_ekg/client/applications.rb
|
79
|
+
- lib/pseng_ekg/client/tasks.rb
|
80
|
+
- lib/pseng_ekg/version.rb
|
78
81
|
- lib/pseng_ekg_client.rb
|
79
|
-
- lib/pseng_ekg_client/version.rb
|
80
82
|
- pseng_ekg_client.gemspec
|
81
83
|
- spec/pseng_ekg_client_spec.rb
|
82
84
|
- spec/spec_helper.rb
|