Class: Docopt::TokenStream
- Inherits:
-
Array
- Object
- Array
- Docopt::TokenStream
- Defined in:
- lib/docopt.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #current ⇒ Object
-
#initialize(source, error) ⇒ TokenStream
constructor
A new instance of TokenStream.
- #move ⇒ Object
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
#error ⇒ Object (readonly)
Returns the value of attribute error.
352 353 354 |
# File 'lib/docopt.rb', line 352 def error @error end |
Instance Method Details
#current ⇒ Object
368 369 370 |
# File 'lib/docopt.rb', line 368 def current return self[0] end |
#move ⇒ Object
364 365 366 |
# File 'lib/docopt.rb', line 364 def move return self.shift end |