Class: DocoptNG::TokenStream
- Inherits:
-
Array
- Object
- Array
- DocoptNG::TokenStream
- Defined in:
- lib/docopt_ng/token_stream.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.
5 6 7 8 9 10 11 12 13 |
# File 'lib/docopt_ng/token_stream.rb', line 5 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.
3 4 5 |
# File 'lib/docopt_ng/token_stream.rb', line 3 def error @error end |
Instance Method Details
#current ⇒ Object
19 20 21 |
# File 'lib/docopt_ng/token_stream.rb', line 19 def current self[0] end |
#move ⇒ Object
15 16 17 |
# File 'lib/docopt_ng/token_stream.rb', line 15 def move shift end |