ribimaybe 0.0.5 → 0.0.6

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/ribimaybe.rb +4 -22
  3. data/lib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2ZiYjVmMzM2NTJkMmRiNWFiNmNmNDIxMzRmN2Y3YWYxNTFmZTJkMw==
4
+ ZjBmMGVlZWNhZmRjMjE3ZjQzODZmYzVjYTIwNTE5MzUwYTBhZjQ3ZA==
5
5
  data.tar.gz: !binary |-
6
- NDM2NTVjY2Y1NTI5NzZiZTU0MjdmYTAyYmZkZDgyY2JkNTI0NTM4MQ==
6
+ Nzk2ZDNjMDBhZjIwYzI4ZGY2ZjNlYWM0MzZmYThlZDQ2MDYwYThjMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2ZlNGY0MDU0Y2QzOGUzMDE2NDk3NDJhZDI2M2Q5Nzk0YTk5Zjc3YzI1ZDA1
10
- YzMzZWZmNmJhOTllOGIzZWZkYzE3ZjhjNGFhNDhiY2Q3ODU1NTU4NTJkNDFj
11
- OGI2NzBlM2MwZjZmZjRmNTgxOWYxODA0MTEyMmFkZTJkM2M4NDk=
9
+ NTA5NmVjYzAwZDc5YjExYmNhYzU3ODIzODg2OWZjMTdhN2EyNDYxMDlmODYx
10
+ NGI1ZmFhNGYzMGJlZjc5YzZhOTUwOTIzNDNhZmJhZjcwMjNlMDc2MWQxODk5
11
+ YmIwNGQxMTZmOTY3ZmNjZGZlNWFhZmYyMTRmYjU4Y2NhYjQyMDE=
12
12
  data.tar.gz: !binary |-
13
- ODExNTFhMDIyNDQyOWE3ZTY0YzJkM2QzMGUxZjQ5ZGFjZjllMjBkZTA3Mzc3
14
- NDk0MWFhNTc3NGVjMmU4OTI4YWY3YmU2ODcwZmZlMTU1MDg2NWU2OTkyMWY3
15
- NzRlNjhmYjkzNWI5MzcyMDMyMTgyYzZjMzE5NTQxYzNhMTczYTY=
13
+ M2I4NDU1NjRiOTQwYTUzNzFjOTNkZTRhMWVmYzViYTY3OTBjMjM0OTQxYmI0
14
+ MWE4YzA5MDNhNWM4ZmZhYjI1NmI3M2YyNzQzYzUwYmI2NWMyNzA2NzY5ZWZk
15
+ Y2UzNzNmOTg1YjU3NGYwZTQ1YmE4NDMxY2VmODczYTZlZjY3ODg=
data/lib/ribimaybe.rb CHANGED
@@ -157,29 +157,11 @@ module Ribimaybe
157
157
  #
158
158
  Contract Any, Or[nil, Proc] => Or[Nothing, Just]
159
159
  def Maybe(value = nil, &fn)
160
- (value || fn) ? Just(value || fn) : Nothing
160
+ (value || fn) ? Just.new(value || fn.curry) : Nothing
161
161
  end
162
162
 
163
- # Wraps a value or a function in a Just or returns a Nothing.
164
- #
165
- # ==== Attributes
166
- #
167
- # * +value+ - Value to be wrapped.
168
- # * +fn+ - Block or function to be wrapped.
169
- #
170
- # ==== Examples
171
- #
172
- # Just(nil) # => Nothing
173
- # Just(1) # => Just(1)
174
- # Just { |x| x } # => Just(#<Proc:0x007fdecc03a478@(irb):6>)
175
- #
176
- Contract Any, Or[nil, Proc] => Or[Nothing, Just]
177
- def Just(value = nil, &fn)
178
- return Nothing unless (value || fn)
179
- Just.new(value || fn.curry)
180
- end
181
-
182
- alias_method :pure, :Just
183
- alias_method :rturn, :Just
163
+ alias_method :Just, :Maybe
164
+ alias_method :pure, :Maybe
165
+ alias_method :rturn, :Maybe
184
166
  end
185
167
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ribimaybe
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ribimaybe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - unsymbol