cloverly 0.1.1 → 0.1.2
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/base.rb +10 -1
- 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: d51ec558ca64aea181ea9a348b92f3fed3c255bd2481c3bf59348b985b2c150c
|
|
4
|
+
data.tar.gz: 3eeb44f867e62f67cc89d630d9f163cf0dd9ef7eb4f3f93e7b32262aaf4bd130
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c0c523e93609f1200fc21a5b2f04eac5136cef4c6180da53f4510531e54fec92b81667ab89ef053b3349fcfd1c9fe5bb6b49834ff9d3804f6e06828f63e07d3
|
|
7
|
+
data.tar.gz: caeb263fa4f97b49cbb4ee38f8eaa6b4a69f22b1f3063b7724bc9a01894479230cf649f83aa695666d899b3318dc776884ff64e95f90fcfe2147de4d4990cdbd
|
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
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cloverly
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Winslett
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-05-
|
|
11
|
+
date: 2019-05-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|