teamsnap_rb 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/teamsnap_rb/client.rb +1 -1
- data/lib/teamsnap_rb/collection.rb +24 -0
- data/lib/teamsnap_rb/version.rb +1 -1
- data/spec/collection_spec.rb +36 -0
- data/spec/fixtures/cassettes/production_root.yml +1 -1
- 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: b7d2fa31f938ab3823bb36c4c6d1717afe5f88a1
|
4
|
+
data.tar.gz: d2573216d36f51ed5d9c791fbafaac27729e7f5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37202379f9ec80a10cc4e351c419962b3db2094077a33cfc7ecbd29aa0cc6d8473afeed3640b68453b1004439a48e5582864b32f20d8c817474d48a4b277fcd0
|
7
|
+
data.tar.gz: 44c0684500659687b8e230ebbd844b941970e42a86cd506b7ab46b149a87cf0df2c81191fa18775358d2f9e1ce84e428a3a0c9bdcf4d50fdec57e23a1a67711d
|
data/lib/teamsnap_rb/client.rb
CHANGED
@@ -95,6 +95,18 @@ module TeamsnapRb
|
|
95
95
|
errors.count > 0
|
96
96
|
end
|
97
97
|
|
98
|
+
def size
|
99
|
+
items.size
|
100
|
+
end
|
101
|
+
|
102
|
+
def present?
|
103
|
+
items.size > 0
|
104
|
+
end
|
105
|
+
|
106
|
+
def blank?
|
107
|
+
items.size == 0
|
108
|
+
end
|
109
|
+
|
98
110
|
private
|
99
111
|
|
100
112
|
attr_accessor :collection_json, :config, :items, :url
|
@@ -135,6 +147,18 @@ module TeamsnapRb
|
|
135
147
|
end
|
136
148
|
end
|
137
149
|
|
150
|
+
def size
|
151
|
+
items.size
|
152
|
+
end
|
153
|
+
|
154
|
+
def present?
|
155
|
+
items.size > 0
|
156
|
+
end
|
157
|
+
|
158
|
+
def blank?
|
159
|
+
items.size == 0
|
160
|
+
end
|
161
|
+
|
138
162
|
def where(attribute_hash)
|
139
163
|
CollectionWhereProxy.new(find_all do |item|
|
140
164
|
attribute_hash.keys.all? do |key|
|
data/lib/teamsnap_rb/version.rb
CHANGED
data/spec/collection_spec.rb
CHANGED
@@ -66,6 +66,24 @@ describe TeamsnapRb::Collection do
|
|
66
66
|
expect(root_collection.error?).to eq(false)
|
67
67
|
end
|
68
68
|
end
|
69
|
+
|
70
|
+
describe "size" do
|
71
|
+
it "returns zero when there are no items" do
|
72
|
+
expect(root_collection.size).to eq(0)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe "present?" do
|
77
|
+
it "returns false when there are no iteams" do
|
78
|
+
expect(root_collection.present?).to eq(false)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe "blank?" do
|
83
|
+
it "returns true when there are no iteams" do
|
84
|
+
expect(root_collection.blank?).to eq(true)
|
85
|
+
end
|
86
|
+
end
|
69
87
|
end
|
70
88
|
|
71
89
|
context "GET /teams/1", :vcr, record: :once do
|
@@ -106,6 +124,24 @@ describe TeamsnapRb::Collection do
|
|
106
124
|
end
|
107
125
|
end
|
108
126
|
|
127
|
+
describe "size" do
|
128
|
+
it "returns zero when there are no items" do
|
129
|
+
expect(team_collection.size).to eq(1)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
describe "present?" do
|
134
|
+
it "returns true when there are no iteams" do
|
135
|
+
expect(team_collection.present?).to eq(true)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
describe "blank?" do
|
140
|
+
it "returns false when there are no iteams" do
|
141
|
+
expect(team_collection.blank?).to eq(false)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
109
145
|
describe "#where" do
|
110
146
|
it "returns a CollectionWhereProxy" do
|
111
147
|
expect(team_collection.where({})).to be_a(TeamsnapRb::Collection::CollectionWhereProxy)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamsnap_rb
|
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
|
- Party Chicken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|