danom 0.1.2 → 0.2.0

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: cfe8b50327722de84183e14528b0d96ec5cf192a
4
- data.tar.gz: a3619767c0d4cfcc3c95136346578d60c6579f41
3
+ metadata.gz: 84b0f959b6132268a2068cd3aecbd7ade58b4531
4
+ data.tar.gz: 345b8e59e553d9bd89b2ac788d1078c1644d1f67
5
5
  SHA512:
6
- metadata.gz: 8f915e0214013e724752d955b1d1e40c8052daf7c7a784d231618e0e318c4a21b1fe06bdf88e205a732218c160f92acba5ee34e95687bb0db5d9f0913879cd46
7
- data.tar.gz: 4de223a72a773f055e201b05ae0743a1e14de6ce493ae3b29f2b32bbe88376189eed2d1369fe51681d20d6d3ecdf969df507eac5b066f6c1fbef83592a43b5a1
6
+ metadata.gz: 5c69c38d6dc718d37582e659b5c56789f8c803369272134c6ab4661ca4b06c47317ecf4a304b43987d47b844e213f53dfd68c1228eb6b47103942f934eba4f02
7
+ data.tar.gz: 483f53f3d4caae6d7dbe8fff125b87a07a190db11c573bc156fb3a5ae518774de734c06df42795b1838b26aa60bfb0f192a3d9a9afa08a92684de6e4b192e05d
data/lib/danom/just.rb CHANGED
@@ -15,7 +15,7 @@ module Danom
15
15
 
16
16
  # @raise [Danom::Just::CannotBeNil] if value is provided as nil
17
17
  def initialize(value)
18
- raise CannotBeNil if value == nil
18
+ raise CannotBeNil if !(Monad === value) && value == nil
19
19
  super
20
20
  end
21
21
 
data/lib/danom/monad.rb CHANGED
@@ -51,15 +51,15 @@ module Danom
51
51
  end
52
52
 
53
53
 
54
- # Calls #to_s on the underlying value.
54
+ # Proxy all Object methods to underlying value
55
55
  #
56
- # @note This happens because method_missing does not override #to_s
57
56
  # @private
58
- def to_s
59
- and_then { |v| v.to_s }
57
+ Object.new.methods.each do |object_method|
58
+ define_method object_method do |*args|
59
+ and_then { |v| v.public_send(object_method, *args) }
60
+ end
60
61
  end
61
62
 
62
-
63
63
  private
64
64
 
65
65
  # Provides convinience for chaining methods together while maintaining a
data/lib/danom/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Danom
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uri Gorelik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-12 00:00:00.000000000 Z
11
+ date: 2018-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler