@@ -51,9 +51,9 @@ module Concurrent
51
51
# ```ruby
52
52
# result = MyFileUtils.consult("data.dat") # returns a Maybe
53
53
# if result.just?
54
- # do_something_useful(result.just ) # or result.value
54
+ # do_something_useful(result.value ) # or result.just
55
55
# else
56
- # logger.error(result.nothing ) # or result.reason
56
+ # logger.error(result.reason ) # or result.nothing
57
57
# end
58
58
# ```
59
59
#
@@ -72,12 +72,12 @@ module Concurrent
72
72
# maybe = MyFileUtils.consult('bogus.file')
73
73
# maybe.just? #=> false
74
74
# maybe.nothing? #=> true
75
- # maybe.nothing #=> #<Errno::ENOENT: No such file or directory @ rb_sysopen - bogus.file>
75
+ # maybe.reason #=> #<Errno::ENOENT: No such file or directory @ rb_sysopen - bogus.file>
76
76
#
77
77
# maybe = MyFileUtils.consult('README.md')
78
78
# maybe.just? #=> true
79
79
# maybe.nothing? #=> false
80
- # maybe.just #=> "# Concurrent Ruby\n[![Gem Version..."
80
+ # maybe.value #=> "# Concurrent Ruby\n[![Gem Version..."
81
81
#
82
82
# @example Using Maybe with a Block
83
83
# result = Concurrent::Maybe.from do
@@ -86,11 +86,11 @@ module Concurrent
86
86
#
87
87
# # -- if the record was found
88
88
# result.just? #=> true
89
- # result.just #=> #<Client id: 10, first_name: "Ryan">
89
+ # result.value #=> #<Client id: 10, first_name: "Ryan">
90
90
#
91
91
# # -- if the record was not found
92
- # result.just? #=> false
93
- # result.nothing #=> ActiveRecord::RecordNotFound
92
+ # result.just? #=> false
93
+ # result.reason #=> ActiveRecord::RecordNotFound
94
94
#
95
95
# @example Using Maybe with the Null Object Pattern
96
96
# # In a Rails controller...
0 commit comments