totally_lazy 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/lib/option.rb +8 -0
  3. data/spec/option_spec.rb +7 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzNiZGM3ZGU2ODAwMTFlZjMxYzg2NzAxYzI5YzA2YzU5YmQyZGNlMA==
4
+ OGM1MDEzNTU2ZDQ0OGRlOTA3MDk5N2JjNGEzZjY2NDJkOTY4Y2M2MQ==
5
5
  data.tar.gz: !binary |-
6
- NGQ5ZDc1ZTQ4YWFkZmExMzJlMDAwMGI2NTEwYjA1MWMxZDQxY2JmOQ==
6
+ OTAwNWE3ZDk1NDQwNTcyYTZmZDU2MDM2NTY3NmFhNWEyZWRhM2RmMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzZjYzZiNTI1M2QwMjNmNGRmNjQzYjA1NjY3YTUxNDk3OTNlYjQ1NTAwNzU3
10
- NzlmNGZiZWQxMDNkNDNmNGUxMTQ0MTYxMGE2NGRhMTcwMDg2MjExOTI5NGU4
11
- ODZmZTVlN2YyMTAzZDQ4ZTZhY2E1ODU2MTdiNDJiOGZiNDI3YTM=
9
+ ZGUxODhhYTkzOGFjMTBkZTY4YTdmYTdiN2Y4MmFkNTQzZGEwMGI1YWJiNDQ3
10
+ MDQ5Yzk4OGJhYTlhODZkZTVkMTY3NTQ5N2RjMGE1NmM2OTcwMzE4YmRmMmM2
11
+ NjhjYWQ3MzEyMmRkMWQ5ZDBhMjQ5MDljOGQ0MjFjYjA5Y2FiYzY=
12
12
  data.tar.gz: !binary |-
13
- ZGI0ZjdmYWQ0MjViOWU4Y2Q2ODdmYjlkYTUxNWFkOGM5MDAwNDIyM2MxN2Vm
14
- NjJkN2FhZWE3ZWMxN2U4ZmQ0MzI0NGY1NDlkNzE5MDFiZGQxOWFhZjk2MDlh
15
- OWNiNDVmZjZhOTk1OWRiN2ZiOWVlODdlZmI2YWFkMDkxZWQzOTI=
13
+ YzY2YjUzMmRkMmQyNjdkY2M1ODFiYWFmMWU0Mjg5MmUxMWMxYjk1NmY3MTk5
14
+ ZDY3YjJlYmQyZTU1OWU2ZTJlYzdmY2U4ZWY1NTZhYzNhNzI3NjM3MDRiYjk2
15
+ ZTBhY2I1ODhhNDExMzY2MzA5NDZmYWY1NWUyMGNiNWYzN2JjYTI=
data/lib/option.rb CHANGED
@@ -26,6 +26,10 @@ module Option
26
26
  @value = value
27
27
  end
28
28
 
29
+ def contains?(value)
30
+ @value == value
31
+ end
32
+
29
33
  def map(fn)
30
34
  some(fn.(value))
31
35
  end
@@ -55,6 +59,10 @@ module Option
55
59
  true
56
60
  end
57
61
 
62
+ def contains?(_)
63
+ false
64
+ end
65
+
58
66
  def map(fn)
59
67
  none
60
68
  end
data/spec/option_spec.rb CHANGED
@@ -7,4 +7,11 @@ describe 'Option' do
7
7
  expect(none.is_empty?).to eq(true)
8
8
  expect(none.is_defined?).to eq(false)
9
9
  end
10
+
11
+ it 'should support contains?' do
12
+ expect(option(1).contains?(1)).to eq(true)
13
+ expect(option(1).contains?(2)).to eq(false)
14
+ expect(none.contains?(2)).to eq(false)
15
+ end
16
+
10
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totally_lazy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raymond Barlow