cloverly 0.1.1 → 0.2.0
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/cloverly.rb +1 -1
- data/lib/cloverly/base.rb +10 -1
- data/lib/cloverly/estimate.rb +5 -3
- data/lib/cloverly/purchase.rb +6 -4
- data/lib/cloverly/source.rb +2 -2
- data/lib/cloverly/version.rb +5 -0
- metadata +15 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57bc13b5f60b560246cdf80e70dcc46b445f25e323610026959b65cceac57029
|
4
|
+
data.tar.gz: 22b3024715bb0638584a9e4a7c68154ae346001e8ffd988e3e81ced33302f8b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cd3818cf0608fe099a766a334f0b29649cfdd0a9db326f4fee6f8b7ab07915f246295d991ded1baa818604fba42485034b692cf7d4861ff78df7bebf1d55e9a
|
7
|
+
data.tar.gz: 459d4c6121c9a98e83f918c9a5d02a314df496febd683c7dd49c51aec59d3259b93c00f02d1410e39565444aee85eb1896c6907d08c8cd0ae51e75f47d7d38bd
|
data/lib/cloverly.rb
CHANGED
data/lib/cloverly/base.rb
CHANGED
@@ -10,6 +10,14 @@ module Cloverly::Base
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
def to_json
|
14
|
+
@json
|
15
|
+
end
|
16
|
+
|
17
|
+
def json=(json)
|
18
|
+
@json = json
|
19
|
+
end
|
20
|
+
|
13
21
|
def self.included(base)
|
14
22
|
base.extend ClassMethods
|
15
23
|
base.class_eval do
|
@@ -18,13 +26,14 @@ module Cloverly::Base
|
|
18
26
|
|
19
27
|
module ClassMethods
|
20
28
|
def parse(cloverly_instance, json_response)
|
21
|
-
|
22
29
|
if json_response.is_a?(Array)
|
23
30
|
json_response.map do |item_json|
|
24
31
|
self.parse(cloverly_instance, item_json)
|
25
32
|
end
|
26
33
|
else
|
27
34
|
instance = self.new(cloverly_instance)
|
35
|
+
|
36
|
+
instance.json = json_response
|
28
37
|
instance.attributes = json_response
|
29
38
|
|
30
39
|
instance
|
data/lib/cloverly/estimate.rb
CHANGED
@@ -12,11 +12,13 @@ class Cloverly::Estimate
|
|
12
12
|
class << self
|
13
13
|
|
14
14
|
def retrieve(cloverly_instance = nil, slug)
|
15
|
-
|
15
|
+
c = cloverly_instance || Cloverly.default
|
16
|
+
Cloverly::Estimate.parse(c, c.get("/2019-03-beta/estimates/#{slug}"))
|
16
17
|
end
|
17
18
|
|
18
|
-
def list
|
19
|
-
|
19
|
+
def list(cloverly_instance = nil)
|
20
|
+
c = cloverly_instance || Cloverly.default
|
21
|
+
Cloverly::Estimate.parse(c, c.get("/2019-03-beta/estimates"))
|
20
22
|
end
|
21
23
|
|
22
24
|
def shipping(args)
|
data/lib/cloverly/purchase.rb
CHANGED
@@ -11,12 +11,14 @@ class Cloverly::Purchase
|
|
11
11
|
|
12
12
|
class << self
|
13
13
|
|
14
|
-
def retrieve(slug)
|
15
|
-
|
14
|
+
def retrieve(cloverly_instance = nil, slug)
|
15
|
+
c = cloverly_instance || Cloverly.default
|
16
|
+
Cloverly::Purchase.parse(c, c.get("/2019-03-beta/purchases/#{slug}"))
|
16
17
|
end
|
17
18
|
|
18
|
-
def list
|
19
|
-
|
19
|
+
def list(cloverly_instance = nil)
|
20
|
+
c = cloverly_instance || Cloverly.default
|
21
|
+
Cloverly::Purchase.parse(c, c.get("/2019-03-beta/purchases"))
|
20
22
|
end
|
21
23
|
|
22
24
|
def shipping(args)
|
data/lib/cloverly/source.rb
CHANGED
@@ -3,11 +3,11 @@ class Cloverly::Source
|
|
3
3
|
|
4
4
|
class << self
|
5
5
|
def retrieve(slug)
|
6
|
-
Cloverly::Source.parse(Cloverly.default, Cloverly.default.get("/2019-03-beta/
|
6
|
+
Cloverly::Source.parse(Cloverly.default, Cloverly.default.get("/2019-03-beta/offsets/#{slug}"))
|
7
7
|
end
|
8
8
|
|
9
9
|
def list
|
10
|
-
Cloverly::Source.parse(Cloverly.default, Cloverly.default.get("/2019-03-beta/
|
10
|
+
Cloverly::Source.parse(Cloverly.default, Cloverly.default.get("/2019-03-beta/offsets"))
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloverly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Winslett
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.9'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0.9'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rspec
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,13 +113,14 @@ files:
|
|
107
113
|
- lib/cloverly/estimate.rb
|
108
114
|
- lib/cloverly/purchase.rb
|
109
115
|
- lib/cloverly/source.rb
|
116
|
+
- lib/cloverly/version.rb
|
110
117
|
homepage: https://cloverly.com
|
111
118
|
licenses:
|
112
119
|
- MIT
|
113
120
|
metadata:
|
114
121
|
source_code_uri: https://github.com/cloverly/cloverly-ruby-gem
|
115
122
|
bug_tracker_uri: https://github.com/cloverly/cloverly-ruby-gem/issues
|
116
|
-
post_install_message:
|
123
|
+
post_install_message:
|
117
124
|
rdoc_options: []
|
118
125
|
require_paths:
|
119
126
|
- lib
|
@@ -128,9 +135,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
135
|
- !ruby/object:Gem::Version
|
129
136
|
version: 1.8.11
|
130
137
|
requirements: []
|
131
|
-
|
132
|
-
|
133
|
-
signing_key:
|
138
|
+
rubygems_version: 3.2.14
|
139
|
+
signing_key:
|
134
140
|
specification_version: 4
|
135
141
|
summary: Ruby library for interaction with Cloverly API
|
136
142
|
test_files: []
|