monadic 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.0
4
+ **BREAKING CHANGES**
5
+ `#to_s` returns the inner value converted to string
6
+
3
7
  ## v0.2.1
4
8
  Nothing has no method #name ... will need to use `BasicObject`
5
9
 
data/README.md CHANGED
@@ -83,6 +83,13 @@ Treat it like an array:
83
83
  Maybe(nil).to_a == []
84
84
  ```
85
85
 
86
+ `to_s`
87
+ ```ruby
88
+ Maybe(nil).to_s == 'Nothing'
89
+ Maybe(1).to_s == '1'
90
+ ```
91
+
92
+
86
93
  Falsey values (kind-of) examples:
87
94
 
88
95
  ```ruby
data/lib/monadic/maybe.rb CHANGED
@@ -41,6 +41,10 @@ module Monadic
41
41
  def method_missing(m, *args)
42
42
  Maybe(@value.__send__(m, *args))
43
43
  end
44
+
45
+ def to_s
46
+ @value.to_s
47
+ end
44
48
  end
45
49
 
46
50
  # Represents a NullObject
@@ -1,3 +1,3 @@
1
1
  module Monadic
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
data/spec/maybe_spec.rb CHANGED
@@ -64,8 +64,8 @@ describe Monadic::Maybe do
64
64
  Maybe('foo').empty?.should be_false
65
65
  end
66
66
 
67
- it 'Just#to_s is "Just(value)"' do
68
- Just.unit(123).to_s.should == "Just(123)"
67
+ it 'Just#to_s is "value"' do
68
+ Just.unit(123).to_s.should == "123"
69
69
  end
70
70
  end
71
71
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monadic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -173,7 +173,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  segments:
175
175
  - 0
176
- hash: 634459162394168513
176
+ hash: -2586124281524305504
177
177
  required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  none: false
179
179
  requirements:
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  segments:
184
184
  - 0
185
- hash: 634459162394168513
185
+ hash: -2586124281524305504
186
186
  requirements: []
187
187
  rubyforge_project:
188
188
  rubygems_version: 1.8.24