sortify 0.1.3 → 0.1.4

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: 90913629f16a78cf002f0c66ef5d7d5f81d3db16
4
- data.tar.gz: 3aefec03ca108c17e25e198af0eae9afeee06923
3
+ metadata.gz: e84867d37d9efc16c5ee29d296e261b6046acddb
4
+ data.tar.gz: 56560b44ea5f6d01c15917c20275ce441565c050
5
5
  SHA512:
6
- metadata.gz: 695844cd58a5e32139880ca10f227e757e2bf2241d1700d8f17eee6ee15e4aae16c1ec4f9bbedefa3dffe2d6620caad276f909926ac7fd5e384e0cdced9aa1a6
7
- data.tar.gz: 25e3fb560e345fb3faa7b1710cb6e25620db5d17193a4a80f6da6d01be799a2e3cc305745d293dbbce6e6582ad8665f490cd8f2e2b5e590edaa82f9763425164
6
+ metadata.gz: db9a4367e424d452437fd610d97685648ab3839017f8648033d1e571582d7015b73f053611dc1fc6752bfa70879d2b588ba83c1def71eaf787b26b804bf5cae1
7
+ data.tar.gz: 3a405e1f36e78d806ca7ccad2c6f545bf3f7eace83c581b9fca7e0c3d9d5d8469782eb5789c0d5a19a8dfb193d96cf22ee18473f91dd99072d75b7a3e5d5b323
data/lib/sortify.rb CHANGED
@@ -25,12 +25,14 @@ module Sortify
25
25
 
26
26
  if @sort_options.include? sort_option
27
27
  self.send(sort_option)
28
- else
28
+ elsif sort_option.empty?
29
29
  begin
30
30
  self.send(@default_sort_option)
31
31
  rescue
32
- raise NoMethodError, "The default sort option you provided, '#{@default_sort_option.to_s}' does not exist."
32
+ raise NoMethodError, "The default sort option you provided, '#{@default_sort_option.to_s}', does not exist."
33
33
  end
34
+ else
35
+ raise NoMethodError, "The sort option you provided, '#{sort_option}', does not exist."
34
36
  end
35
37
  end
36
38
  end
@@ -1,3 +1,3 @@
1
1
  module Sortify
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sortify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Melody