Class: OptparseLite::Help::SexpWrapper

Inherits:
Object
  • Object
show all
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

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