parfait 0.12.3 → 0.12.4
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/parfait/region.rb +17 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a2dabfca724bceaae71fff18a3f29c8839a9ce8
|
4
|
+
data.tar.gz: 576c4a3f16d8908121b8841818cde77c54b16b6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5baf98ac23d3b4fabe4777c698e4c22e8445efc4ecc7e7dc8f058485a04aea415ba61added2a4123c6ea29ed6e4371a91c8cff67afbebebc789060b1f193bb36
|
7
|
+
data.tar.gz: b654f95303d55ef4e3cd6d339c35a6b2cf1e50062bc306a646affc664f61807b73ca80728e061fd3bb6c55fa2a950c4456362bb5a495615253cfa233751522f3
|
data/lib/parfait/region.rb
CHANGED
@@ -259,21 +259,33 @@ module Parfait
|
|
259
259
|
#
|
260
260
|
# *Options*
|
261
261
|
#
|
262
|
-
# +
|
262
|
+
# +opts+:: is either a hash with a key specifying the name of the region and a value
|
263
|
+
# specifying the filter search value OR is a value specifying the name of the region
|
263
264
|
#
|
264
265
|
# *Example*
|
265
266
|
#
|
266
267
|
# myregion.region("User List" => username)
|
268
|
+
# myregion.region("Chat Box")
|
267
269
|
#
|
268
270
|
def region(opts = {})
|
269
|
-
|
271
|
+
if opts.is_a?(Hash)
|
272
|
+
region_name = opts.first[0]
|
273
|
+
else
|
274
|
+
region_name = opts
|
275
|
+
end
|
276
|
+
region = @regions[region_name]
|
277
|
+
|
270
278
|
if region
|
271
279
|
|
272
|
-
# Confirm that we are
|
273
|
-
verify_presence "Cannot navigate to region \"#{
|
280
|
+
# Confirm that we are on the expected page
|
281
|
+
verify_presence "Cannot navigate to region \"#{region_name}\" because region presence check failed"
|
274
282
|
|
275
283
|
# Apply the filter method
|
276
|
-
|
284
|
+
if opts.is_a?(Hash)
|
285
|
+
region.filter(opts.first[1])
|
286
|
+
else
|
287
|
+
region.filter(opts)
|
288
|
+
end
|
277
289
|
|
278
290
|
return region
|
279
291
|
else
|