skipio_api 0.0.7 → 0.0.8
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/skipio.rb +10 -3
- 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: 552c39370a4c13280e4a21904ecf5dbcd2f1526b
|
4
|
+
data.tar.gz: 2e4606971f6629a0bf205d3722241d4bfdc96646
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 549b6fed19176b211f5401d78876aee24076b1b003903865c35deb4cdd85c18c3b17626204982b42b97cfdd1fb5de94ebb366401b9808463e934b5be1baf601b
|
7
|
+
data.tar.gz: 262fef90284dccb311aa176b0c3044fb0d04b3219ab748a9ab3958011b92a28da75776748bd1351e7e8cfc9f1a7805784e58ddd6d38383f518721443c9f19692
|
data/lib/skipio.rb
CHANGED
@@ -5,10 +5,9 @@ require "addressable/uri"
|
|
5
5
|
require 'open-uri'
|
6
6
|
|
7
7
|
class Skipio
|
8
|
-
API_SERVER = 'https://stage.skipio.com'
|
9
|
-
|
10
8
|
def initialize(options)
|
11
9
|
@token = options[:token]
|
10
|
+
@api_server = options[:api_server] || :dev
|
12
11
|
end
|
13
12
|
|
14
13
|
# params = { page: 1, per: 10 }
|
@@ -45,7 +44,7 @@ class Skipio
|
|
45
44
|
# url = 'v1/contacts'
|
46
45
|
# options = { params: { Hash: parameters }, json: { Hash: json } }
|
47
46
|
def process_by_url(url, action, options = {})
|
48
|
-
uri = URI.parse("#{
|
47
|
+
uri = URI.parse("#{api_server}/api/#{url}?token=#{@token}&#{options[:params]}")
|
49
48
|
if action == :get
|
50
49
|
response = Net::HTTP.get(uri)
|
51
50
|
elsif action == :post
|
@@ -56,6 +55,14 @@ class Skipio
|
|
56
55
|
response
|
57
56
|
end
|
58
57
|
|
58
|
+
def api_server
|
59
|
+
if @api_server == :prod
|
60
|
+
'https://app.skipio.com'
|
61
|
+
elsif :dev
|
62
|
+
'https://stage.skipio.com'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
59
66
|
private
|
60
67
|
|
61
68
|
def create_by_url(uri, json_data)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skipio_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Psalmuel Aguilar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|