key-vortex 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
  SHA256:
3
- metadata.gz: 9f6da23cf8420370cc93a363086dbca57eb2d7302f5536f33d587f0e5a73d4ab
4
- data.tar.gz: 6b0746f97f7a85ac194cda6cd94badf07c9bafc328c72011a4095a61a3c98841
3
+ metadata.gz: 2ef4caa4048de91fa4f99f928fd154c9ae3950a971fb6d8ad34149070f900914
4
+ data.tar.gz: 179229a1dd86d3e31fa2dca1d43089ab11000625a5260c5aaf8c31c7a691f3c8
5
5
  SHA512:
6
- metadata.gz: 40516afe2704956138c7946941974b4e7ee6480b696d38388a8519616de9df23bd4b26d2c6b2e1779f73c696808b4426e0c037ada0f5c4a5c4ed04c56df1c701
7
- data.tar.gz: a23ebe43edd781403791da6641e47e9344b8172f71307024bc30a966c0a39797837a02f4a29851ce3e02b2d782afaab22f970c502c2499197c033bdb76623eb6
6
+ metadata.gz: 7c847153af457304066f16e28436a018f289e73b1a929811e506c83d5bfb1da3d45be68a89b6c3781207dd11481753cfd9ec6b95335da58c6a88fc072d65546f
7
+ data.tar.gz: cfddc7282c2775b03595c679a3369c61584069b2cb961eeb68194ecb9d62fa1c204602611a1be473c410271648bcb3f7fe4b6b8230dacd874e3b2daea66a119a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- key-vortex (0.1.3)
4
+ key-vortex (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/Guardfile CHANGED
@@ -27,7 +27,7 @@
27
27
  # * 'just' rspec: 'rspec'
28
28
 
29
29
  group :red_green_refactor, halt_on_fail: true do
30
- guard :rspec, cmd: "bundle exec rspec", all_on_pass: true do
30
+ guard :rspec, cmd: "bundle exec rspec", failed_mode: :focus, all_on_pass: true do
31
31
  require "guard/rspec/dsl"
32
32
  dsl = Guard::RSpec::Dsl.new(self)
33
33
 
@@ -8,7 +8,7 @@ class KeyVortex
8
8
  end
9
9
 
10
10
  def within?(constraint)
11
- !applies_to?(constraint) || within_applicable?(constraint)
11
+ constraint.instance_of?(self.class)
12
12
  end
13
13
 
14
14
  def to_s
@@ -16,8 +16,8 @@ class KeyVortex
16
16
  :length
17
17
  end
18
18
 
19
- def within_applicable?(constraint)
20
- value <= constraint.value
19
+ def within?(constraint)
20
+ super && value <= constraint.value
21
21
  end
22
22
  end
23
23
  end
@@ -16,8 +16,8 @@ class KeyVortex
16
16
  :maximum
17
17
  end
18
18
 
19
- def within_applicable?(constraint)
20
- value <= constraint.value
19
+ def within?(constraint)
20
+ super && value <= constraint.value
21
21
  end
22
22
  end
23
23
  end
@@ -16,8 +16,8 @@ class KeyVortex
16
16
  :maximum
17
17
  end
18
18
 
19
- def within_applicable?(constraint)
20
- value >= constraint.value
19
+ def within?(constraint)
20
+ super && value >= constraint.value
21
21
  end
22
22
  end
23
23
  end
@@ -30,10 +30,16 @@ class KeyVortex
30
30
  !allows?(limitation)
31
31
  end
32
32
 
33
+ def applicable_constraints(constraint)
34
+ @constraints.select do |con|
35
+ con.applies_to?(constraint)
36
+ end
37
+ end
38
+
33
39
  def accomodates?(constraint)
34
- @constraints.all? do |con|
40
+ !applicable_constraints(constraint).select do |con|
35
41
  con.within?(constraint)
36
- end
42
+ end.empty?
37
43
  end
38
44
 
39
45
  def to_s
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class KeyVortex
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: key-vortex
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
  - Lambda Null