cumulus_ruby 0.1.0 → 0.1.1
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/.gitignore +1 -0
- data/README.md +13 -3
- data/lib/cumulus/client.rb +7 -5
- data/lib/cumulus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec14c83f6625ffedefc7c52ee7a9704a581ef0ee
|
|
4
|
+
data.tar.gz: fd8172525eba1b2fb38bb4ac50d4d2ec224cb990
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 402bfad3ec218186de092c88f5d23860cffedddd056b89e79417fcbfcf6f116581373ae5a2183c1eb9f6d173d2b557477e7d265a3abb3107f5352cd2f17ba5b5
|
|
7
|
+
data.tar.gz: a13a676e5bfcf3bc2a98c3a6261de1acb3a52330e1ec99c3690ba5682f676cad8f3678bf6db23f033d13546cbf8b424f54553d2a36405697b4e17034557c5ff0
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -2,20 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
A Ruby wrapper for the Cumulus API.
|
|
4
4
|
|
|
5
|
+
You should access the Cumulus API documentation in order to learn more about the
|
|
6
|
+
request/response parameters for each endpoint.
|
|
7
|
+
|
|
5
8
|
## Installation
|
|
6
9
|
|
|
7
10
|
```
|
|
8
11
|
$ gem install cumulus_ruby
|
|
9
12
|
```
|
|
10
13
|
|
|
14
|
+
Or if you are using Bundler, add
|
|
15
|
+
|
|
16
|
+
````
|
|
17
|
+
gem 'cumulus_ruby'
|
|
18
|
+
```
|
|
19
|
+
|
|
11
20
|
## API Usage Examples
|
|
12
21
|
|
|
13
22
|
You will need to get an access token. Once you have it, initialize the client
|
|
14
|
-
to make authenticated
|
|
23
|
+
to make authenticated calls.
|
|
15
24
|
|
|
16
25
|
```ruby
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
require 'cumulus'
|
|
27
|
+
|
|
28
|
+
client = Cumulus::Client.new(token: '<redacted>', url: '<redacted>')
|
|
19
29
|
```
|
|
20
30
|
|
|
21
31
|
### Patients
|
data/lib/cumulus/client.rb
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
require 'faraday'
|
|
2
|
-
require 'logger'
|
|
3
2
|
require 'faraday_middleware'
|
|
4
3
|
|
|
5
4
|
module Cumulus
|
|
6
5
|
class Client
|
|
7
|
-
attr_accessor :request
|
|
8
|
-
|
|
9
|
-
API_URL = 'https://api-cumulus.com'
|
|
6
|
+
attr_accessor :request, :url
|
|
10
7
|
|
|
11
8
|
def initialize(options={})
|
|
12
9
|
@token = options[:token]
|
|
10
|
+
@url = options[:url]
|
|
13
11
|
end
|
|
14
12
|
|
|
15
13
|
def request(type, path, params={})
|
|
@@ -51,8 +49,12 @@ module Cumulus
|
|
|
51
49
|
@token
|
|
52
50
|
end
|
|
53
51
|
|
|
52
|
+
def url
|
|
53
|
+
@url
|
|
54
|
+
end
|
|
55
|
+
|
|
54
56
|
def connection
|
|
55
|
-
@connection ||= Faraday.new(url:
|
|
57
|
+
@connection ||= Faraday.new(url: url) do |b|
|
|
56
58
|
b.adapter Faraday.default_adapter
|
|
57
59
|
b.use FaradayMiddleware::ParseJson
|
|
58
60
|
end
|
data/lib/cumulus/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cumulus_ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Amed Rodriguez
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|