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.
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
#error ⇒ Object (readonly)
Returns the value of attribute error.
375 376 377 |
# File 'lib/docopt.rb', line 375 def error @error end |
Instance Method Details
#current ⇒ Object
391 392 393 |
# File 'lib/docopt.rb', line 391 def current return self[0] end |
#move ⇒ Object
387 388 389 |
# File 'lib/docopt.rb', line 387 def move return self.shift end |