Class: OptparseLite::Help::SexpWrapper
- Inherits:
-
Object
- Object
- OptparseLite::Help::SexpWrapper
- Defined in:
- lib/optparse-lite.rb
Overview
hack so you can access .first on nil nodes
Defined Under Namespace
Classes: NilSexpClass
Constant Summary collapse
- NilSexp =
NilSexpClass.new
Instance Method Summary collapse
- #[](idx) ⇒ Object
- #each_with_index(*a, &b) ⇒ Object
-
#initialize(sexp) ⇒ SexpWrapper
constructor
A new instance of SexpWrapper.
Constructor Details
#initialize(sexp) ⇒ SexpWrapper
Returns a new instance of SexpWrapper.
449 |
# File 'lib/optparse-lite.rb', line 449 def initialize(sexp); @sexp = sexp end |
Instance Method Details
#[](idx) ⇒ Object
451 |
# File 'lib/optparse-lite.rb', line 451 def [](idx); it = @sexp[idx] and it or NilSexp; end |
#each_with_index(*a, &b) ⇒ Object
450 |
# File 'lib/optparse-lite.rb', line 450 def each_with_index(*a, &b); @sexp.each_with_index(*a, &b); end |