juncture 0.1.1 → 0.1.2

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: 61b996b0d6978fb289c9febfb3e9b847d07b5d0a
4
- data.tar.gz: f8c9a2bbded8d77c3b4c77df3efdc7b830806066
3
+ metadata.gz: bc76c4cc245934c24f3e67dec255cb33949d16ba
4
+ data.tar.gz: 5f49ebd01f47ec182ae9af2f4041f904b7584562
5
5
  SHA512:
6
- metadata.gz: 86aece69ac367895594029e69211559472e235175bc40ad8acd931440a962782d6143e410d8236059c780ea087447063f6a8b6a8cd9fc035a266604a0db2389e
7
- data.tar.gz: e5b85b56992a3e2bee953f026946c9329172784504d45e19384ae5fd722e28e88df92b809105732b72db1a5029e532b67a00e87a68726fe4587903f047a5f5e8
6
+ metadata.gz: d97a227a484135fa8309a04d720d03733d0bbe67eec4b0b93232932b3be830ed61c93ab686cf9602a3965f5d777221abed1dae9700148bc54c01dbf4b3c284c9
7
+ data.tar.gz: 8170557309b5875213a0de13fc3bc429a542a93367cb09e4855fefb478441e3f3358250aa3694ecc4d6f1ea80358eebeb3c74135ba72e9eb148fa03eae7024db
@@ -1,4 +1,4 @@
1
1
  class Juncture
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  DATE = "2014-02-04".freeze
4
4
  end
data/lib/juncture.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  class Juncture
2
+ attr_reader :states
3
+
2
4
  def initialize *states, **kwargs
3
5
  @states = states
4
6
  @current_state = kwargs[:default]
@@ -42,7 +44,7 @@ class Juncture
42
44
  end
43
45
 
44
46
  def <(value)
45
- @states[index+1..-1].include? value
47
+ @states[(index+1)..-1].include? value
46
48
  end
47
49
 
48
50
  def <=(value)
@@ -50,7 +52,7 @@ class Juncture
50
52
  end
51
53
 
52
54
  def >(value)
53
- @states[0..index-1].include? value
55
+ @states[0..(index-1)].include? value
54
56
  end
55
57
 
56
58
  def >=(value)
@@ -110,9 +110,19 @@ describe Juncture do
110
110
  temp = Juncture.new 1, 2, 3, default: 2
111
111
  expect(temp < 2).to be_false
112
112
  end
113
+
114
+ it 'returns false if not matching' do
115
+ temp = Juncture.new 1, 2, 3, default: 2
116
+ expect(temp < 1).to be_false
117
+ end
113
118
  end
114
119
 
115
120
  describe '#<=' do
121
+ it 'returns true if matching' do
122
+ temp = Juncture.new 1, 2, 3, default: 2
123
+ expect(temp <= 3).to be_true
124
+ end
125
+
116
126
  it 'returns true if matching' do
117
127
  temp = Juncture.new 1, 2, 3, default: 2
118
128
  expect(temp <= 2).to be_true
@@ -134,9 +144,19 @@ describe Juncture do
134
144
  temp = Juncture.new 1, 2, 3, default: 2
135
145
  expect(temp > 2).to be_false
136
146
  end
147
+
148
+ it 'returns false if not matching' do
149
+ temp = Juncture.new 1, 2, 3, default: 2
150
+ expect(temp > 3).to be_false
151
+ end
137
152
  end
138
153
 
139
154
  describe '#>=' do
155
+ it 'returns true if matching' do
156
+ temp = Juncture.new 1, 2, 3, default: 2
157
+ expect(temp >= 1).to be_true
158
+ end
159
+
140
160
  it 'returns true if matching' do
141
161
  temp = Juncture.new 1, 2, 3, default: 2
142
162
  expect(temp >= 2).to be_true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juncture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Slaughter