crowdskout 0.0.19 → 0.0.20
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5a9480ecb623e28ed0f00839dae2361e1359bbc
|
4
|
+
data.tar.gz: 9584ea92cef3d1dd67afeb82dbe19ded1dbf8c1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a81783f7a8bfa1dfcd6dd22b5a7814705795b77b9bcc4f1af79df5f15e4d26af03b6b68535133d51dd3c76e3954c178e006a5e0624c1e0e80270471671a40850
|
7
|
+
data.tar.gz: b1331c76ac56f973e55fe63e07b918dc02e01b6fe8816ec2e156877e7e7c446e9de6a974281704199f8293fb6a1ece403545b2e34c1c5c1d2378b2c2c884e7fc
|
data/crowdskout.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "crowdskout"
|
8
|
-
s.version = '0.0.
|
8
|
+
s.version = '0.0.20'
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.authors = ["Crowdskout", "Revv","Kyle Schutt"]
|
11
11
|
s.homepage = "https://github.com/revvco/crowdskout"
|
@@ -16,7 +16,13 @@ module Crowdskout
|
|
16
16
|
obj = Value.new
|
17
17
|
if props
|
18
18
|
props.each do |key, value|
|
19
|
-
|
19
|
+
if obj.respond_to? key
|
20
|
+
obj.send("#{key}=", value)
|
21
|
+
else
|
22
|
+
# this will create the attribute if it doesn't exist
|
23
|
+
obj.class.send(:attr_accessor, key)
|
24
|
+
obj.instance_variable_set("@#{key}", value)
|
25
|
+
end
|
20
26
|
end
|
21
27
|
end
|
22
28
|
obj
|
data/lib/crowdskout/version.rb
CHANGED
@@ -46,4 +46,28 @@ describe Crowdskout::Components::Field do
|
|
46
46
|
expect(JSON.parse(component.to_json)).to eq @hash
|
47
47
|
end
|
48
48
|
end
|
49
|
+
context "hash collection" do
|
50
|
+
before do
|
51
|
+
@json_string = %[{
|
52
|
+
"DonationParent" : {
|
53
|
+
"id" : "abcd-abcd-abcd-abcd",
|
54
|
+
"collection" : "PageViews"
|
55
|
+
}
|
56
|
+
}]
|
57
|
+
@hash = JSON.parse(@json_string)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "creates a component" do
|
61
|
+
component = Crowdskout::Components::Field.create(@hash)
|
62
|
+
expect(component.key_name).to eq "DonationParent"
|
63
|
+
component.value.should be_kind_of(Crowdskout::Components::Value)
|
64
|
+
expect(component.value.id).to eq 'abcd-abcd-abcd-abcd'
|
65
|
+
expect(component.value.collection).to eq 'PageViews'
|
66
|
+
end
|
67
|
+
it "generates the correct json object" do
|
68
|
+
component = Crowdskout::Components::Field.create(@hash)
|
69
|
+
expect(JSON.parse(component.to_json)).to eq @hash
|
70
|
+
expect(component.to_json).to include 'collection'
|
71
|
+
end
|
72
|
+
end
|
49
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crowdskout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Crowdskout
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-04-
|
13
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|