centry 0.0.0 → 0.0.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/lib/centry.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d0e14e6324625e59fa054a6795436078db57cf8554a3168e9d130b18a048c86
|
|
4
|
+
data.tar.gz: 0ca1e01eeee535a99a033278ad2d9e854e9217ac86a3044553fa0c3f5221c181
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2348be84a74e98f7dd32deb9acce0c1e7fca866117dffa9732847bf7fd192e6391da8e583997999a2a06a2474bb04794122ef6f14228927b8835ec0495fb843
|
|
7
|
+
data.tar.gz: 6c480d7922c30d87e98b8082335304029c530ee9d1f4c95795f25e61d250f35e3f5544d8e6793c55f1a74ab8df43be475d567d6958ca37a37a31648b6f9ca7bc
|
data/lib/centry.rb
CHANGED
|
@@ -66,7 +66,7 @@ class Centry
|
|
|
66
66
|
# @var payload (opcional) Body del request puede ser un objeto PHP o un arreglo (diccionario), internamente es transformado a JSON.
|
|
67
67
|
def request(endpoint, method, params = {}, payload = {})
|
|
68
68
|
query = params ? URI.encode_www_form(params) : ""
|
|
69
|
-
uri = URI("
|
|
69
|
+
uri = URI("https://www.centry.cl/#{endpoint}?#{query}")
|
|
70
70
|
# uri = URI("https://www.centry.cl/#{endpoint}?#{query}")
|
|
71
71
|
header = {
|
|
72
72
|
"Content-Type" => "application/json",
|
|
@@ -74,10 +74,10 @@ class Centry
|
|
|
74
74
|
}
|
|
75
75
|
# header["Authorization"] = "Bearer #{@access_token}" #if !PUBLIC_ENDPOINTS.include?(endpoint)
|
|
76
76
|
req = case method
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
when :get then Net::HTTP::Get.new(uri, header)
|
|
78
|
+
when :post then Net::HTTP::Post.new(uri, header)
|
|
79
|
+
when :put then Net::HTTP::Put.new(uri, header)
|
|
80
|
+
when :delete then Net::HTTP::Delete.new(uri, header)
|
|
81
81
|
end
|
|
82
82
|
req.add_field("Authorization", "Bearer #{@access_token}") #if !PUBLIC_ENDPOINTS.include?(endpoint)
|
|
83
83
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: centry
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Elías Lama L.
|
|
@@ -17,7 +17,7 @@ extensions: []
|
|
|
17
17
|
extra_rdoc_files: []
|
|
18
18
|
files:
|
|
19
19
|
- lib/centry.rb
|
|
20
|
-
homepage:
|
|
20
|
+
homepage: https://centrycl.github.io/centry-rest-api-docs/
|
|
21
21
|
licenses:
|
|
22
22
|
- MIT
|
|
23
23
|
metadata: {}
|