Issue #12899 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed

----------------------------------------
Bug #12899: OptParse documentation : example is broken
https://bugs.ruby-lang.org/issues/12899#change-61259

* Author: Glork Riouf
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Hello,

The complete example code in OptParse documentation at http://ruby-doc.org/stdlib-2.3.1/libdoc/optparse/rdoc/OptParse.html#class-OptParse-label-Complete+example does not run at all.

There are several problems in this code. call of instance method from class method is one of them.

~~~
 example.rb:32:in `parse': undefined local variable or method `option_parser' for OptparseExample:Class (NameError)
~~~

I tried to fix but I am not experienced enough to find a solution



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>