aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-07 20:04:58 +0000
committerstomar <stomar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-07 20:04:58 +0000
commit8725c98a7fbeb2a9e83c40c0e278c9a122924e53 (patch)
treeb0d06c4c2e909874fd851d6e101b800a15530ea6
parentcff63404619e061d4b2b79135f7d187351c6b9da (diff)
downloadruby-8725c98a7fbeb2a9e83c40c0e278c9a122924e53.tar.gz
refinements.rdoc: improve docs
* doc/syntax/refinements.rdoc: [DOC] fix typos and grammar and remove superfluous "for the first time". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--doc/syntax/refinements.rdoc7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/syntax/refinements.rdoc b/doc/syntax/refinements.rdoc
index 310599d447..d57080686a 100644
--- a/doc/syntax/refinements.rdoc
+++ b/doc/syntax/refinements.rdoc
@@ -181,8 +181,8 @@ When not evaluated:
# not activated here
When defining multiple refinements in the same module inside multiple +refine+ blocks,
-all refinements from the same module are active when a refined method(any of the +.to_json+ method from Example below) is
-called for the first time:
+all refinements from the same module are active when a refined method
+(any of the +to_json+ methods from the example below) is called:
module ToJSON
refine Integer do
@@ -227,7 +227,8 @@ Note that methods in a subclass have priority over refinements in a
superclass. For example, if the method <code>/</code> is defined in a
refinement for Numeric <code>1 / 2</code> invokes the original Integer#/
because Integer is a subclass of Numeric and is searched before the refinements
-for the superclass Numeric. Since the method <code>/</code> is also present in child +Integer+ therefore, the method lookup never went to the superclass.
+for the superclass Numeric. Since the method <code>/</code> is also present
+in child +Integer+, the method lookup does not move up to the superclass.
However, if a method +foo+ is defined on Numeric in a refinement, <code>1.foo</code>
invokes that method since +foo+ does not exist on Integer.