starline 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53f349bc2281f457996dbeb80828b4ad452d4b80
4
- data.tar.gz: 54eca28e8d2dcb42abe550efe43c77d3b53070f9
3
+ metadata.gz: d099ac759bcd0e4b7f7c9aa9e2709e285842c735
4
+ data.tar.gz: 7b46ba4200a12388428b1803430f96cfccc170fb
5
5
  SHA512:
6
- metadata.gz: b98b07ee62f96e4ba7e97cb4dfba119a1e22b15f4ee84bea977701bdd61141965091874b5b5f0bd25648c3d1f3102f89eed9b98dd36a9eb1d1ea1c85fd7abfa3
7
- data.tar.gz: c83e704c404641de1a4866948a9fbea9a7c5c0044042479e3a8e94a133ac37724f66b96db224860b89dca31bb967aed03185545e948ea99dc82bb4d126de4b24
6
+ metadata.gz: d1b390ce4b8906e3c80a638c2dd293fde1057affc412857368d6d6fa3097d8de1df7f11e192296b52bcbaa7e22b6fe99adf55892437ff1fe16c770ba1319f7a1
7
+ data.tar.gz: 8400ae3466767646045d20bd1ba3942abaf9f0c2a3d54c3d19923b50e0d2f96c7a11ee4852b741cf2c2795c72e23cf834a66a05b3a506e2237b36c89ed13ad2b
@@ -24,6 +24,7 @@ module Starline
24
24
  #
25
25
  # Supports only one filter as search parameterfor now.
26
26
  def initialize(search_params_hash)
27
+ raise_invalid_argument_type_error unless search_params_hash.is_a?(Hash)
27
28
  raise_unknown_filter_error if search_params_hash.empty?
28
29
  raise_ambiguous_filter_error if search_params_hash.size > 1
29
30
 
@@ -58,6 +59,11 @@ module Starline
58
59
  OPERATORS[type]
59
60
  end
60
61
 
62
+ def raise_invalid_argument_type_error
63
+ raise ArgumentError,
64
+ "Invalid argument type. Search filter must be a Hash"
65
+ end
66
+
61
67
  def raise_unknown_filter_error
62
68
  raise ArgumentError, "Filter type is unknown"
63
69
  end
@@ -1,3 +1,3 @@
1
1
  module Starline
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: starline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharipov Ruslan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-27 00:00:00.000000000 Z
11
+ date: 2017-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_haversine