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.



354
355
356
357
358
359
360
361
362
# File 'lib/docopt.rb', line 354

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.



352
353
354
# File 'lib/docopt.rb', line 352

def error
  @error
end

Instance Method Details

#currentObject



368
369
370
# File 'lib/docopt.rb', line 368

def current
  return self[0]
end

#moveObject



364
365
366
# File 'lib/docopt.rb', line 364

def move
  return self.shift
end