diff options
-rw-r--r-- | object.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -570,15 +570,14 @@ rb_obj_size(VALUE self, VALUE args, VALUE obj) * 3.next.then {|x| x**x }.to_s #=> "256" * "my string".yield_self {|s| s.upcase } #=> "MY STRING" * - * Good usage for +yield_self+ is values piping in long method - * chains: + * Good usage for +yield_self+ is value piping in method chains: * * require 'open-uri' * require 'json' * * construct_url(arguments). - * yield_self { |url| open(url).read }. - * yield_self { |response| JSON.parse(response) } + * yield_self {|url| open(url).read }. + * yield_self {|response| JSON.parse(response) } * * When called without block, the method returns +Enumerator+, * which can be used, for example, for conditional @@ -587,7 +586,7 @@ rb_obj_size(VALUE self, VALUE args, VALUE obj) * # meets condition, no-op * 1.yield_self.detect(&:odd?) # => 1 * # does not meet condition, drop value - * 2.yeild_self.detect(&:odd?) # => nil + * 2.yield_self.detect(&:odd?) # => nil * */ |