Class: Docopt::TokenStream

Inherits:
Array
  • Object
show all
Defined in:
lib/docopt.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, error) ⇒ TokenStream

Returns a new instance of TokenStream



377
378
379
380
381
382
383
384
385
# File 'lib/docopt.rb', line 377

def initialize(source, error)
  if !source
    source = []
  elsif source.class != ::Array
    source = source.split
  end
  super(source)
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error



375
376
377
# File 'lib/docopt.rb', line 375

def error
  @error
end

Instance Method Details

#currentObject



391
392
393
# File 'lib/docopt.rb', line 391

def current
  return self[0]
end

#moveObject



387
388
389
# File 'lib/docopt.rb', line 387

def move
  return self.shift
end