starline 0.2.0 → 0.2.1
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/starline/entities/distance_filter.rb +6 -0
- data/lib/starline/version.rb +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: d099ac759bcd0e4b7f7c9aa9e2709e285842c735
|
4
|
+
data.tar.gz: 7b46ba4200a12388428b1803430f96cfccc170fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/starline/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fast_haversine
|