pseng_ekg_client 0.1.8 → 0.1.9

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: 0ec0de50fdb8a1675ad58feaee76fe2827909153
4
- data.tar.gz: 4ff7c06eb749397065b8bfa05c78b02eea785f50
3
+ metadata.gz: d8c7d56874c7eff8d5a0c71f96b19602ed7e3a27
4
+ data.tar.gz: e3abb54cfc6776b9ee1a4c77387eb20cf993832d
5
5
  SHA512:
6
- metadata.gz: 88bacdc7118cf9a815a8cab713f782c40655396de7a4b56e0cd0ab201f668fc82808c9ea8116262ac759a1266378f0d13eea0d423058ef2343b7e365dc4bfe56
7
- data.tar.gz: 15c3c65e688b7fabc306a6f34690982a98fbccc29b2796f2f0b1ebff362ee4d90c4804df04c06fd9049caaaeb986d4fff5793ca496dd14f31180a8af2a250e7f
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
@@ -0,0 +1,3 @@
1
+ module PsengEkg
2
+ VERSION = "0.1.9"
3
+ end
@@ -1,38 +1,16 @@
1
- require "pseng_ekg_client/version"
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 PsengEkgClient
5
- class Api
6
+ module PsengEkg
7
+ class Client
6
8
  include HTTParty
7
- VALID_ACTIONS = %w(index show create update destroy)
8
- VALID_RECORD_TYPES = %w(application task)
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
@@ -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 'pseng_ekg_client/version'
4
+ require 'pseng_ekg/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "pseng_ekg_client"
8
- spec.version = PsengEkgClient::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.8
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
@@ -1,3 +0,0 @@
1
- module PsengEkgClient
2
- VERSION = "0.1.8"
3
- end