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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/parfait/region.rb +17 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b127b4ad894e2b6f2a50fd7c591a32d2ebfe2c6
4
- data.tar.gz: 1de9351168fb9cf746c76312c132d4d84c55f004
3
+ metadata.gz: 5a2dabfca724bceaae71fff18a3f29c8839a9ce8
4
+ data.tar.gz: 576c4a3f16d8908121b8841818cde77c54b16b6a
5
5
  SHA512:
6
- metadata.gz: bc4084d1eb53d107ec22fa36b3670063c96d2b5ce448a8ac826cea88419f72189b8b37c7298a9dbe033b84665a5286d8d420e803873db18ca1871ae97835db7c
7
- data.tar.gz: 5d6472a72cfb8994e4ec9ad4403e918112c8a7a1aa334b06f6ab614dc0f70decf46a5cb1099d10560f66ce79be847a231c73a689e11adae20dd841ae707491cd
6
+ metadata.gz: 5baf98ac23d3b4fabe4777c698e4c22e8445efc4ecc7e7dc8f058485a04aea415ba61added2a4123c6ea29ed6e4371a91c8cff67afbebebc789060b1f193bb36
7
+ data.tar.gz: b654f95303d55ef4e3cd6d339c35a6b2cf1e50062bc306a646affc664f61807b73ca80728e061fd3bb6c55fa2a950c4456362bb5a495615253cfa233751522f3
@@ -259,21 +259,33 @@ module Parfait
259
259
  #
260
260
  # *Options*
261
261
  #
262
- # +name+:: specifies the name or alias of the region
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
- region = @regions[opts.first[0]]
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 in the expected region
273
- verify_presence "Cannot navigate to region \"#{opts.first[0]}\" because region presence check failed"
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
- region.filter(opts.first[1])
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parfait
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Rotter