Class: Xcode::Project::Config::IOScanner
- Inherits:
-
Object
- Object
- Xcode::Project::Config::IOScanner
- Defined in:
- lib/xcode/project/config/io_scanner.rb
Constant Summary collapse
- TOKENS =
[ ?}, ?=, ?;, ?{, ?( ].freeze
- DELIMS =
[ ?), ?, ].freeze
Instance Attribute Summary collapse
-
#term ⇒ Object
readonly
Returns the value of attribute term.
Instance Method Summary collapse
- #delimit ⇒ Object
-
#initialize(io) ⇒ IOScanner
constructor
A new instance of IOScanner.
- #tokenize ⇒ Object
Constructor Details
#initialize(io) ⇒ IOScanner
Returns a new instance of IOScanner.
10 11 12 |
# File 'lib/xcode/project/config/io_scanner.rb', line 10 def initialize(io) @io = io end |
Instance Attribute Details
#term ⇒ Object (readonly)
Returns the value of attribute term.
8 9 10 |
# File 'lib/xcode/project/config/io_scanner.rb', line 8 def term @term end |
Instance Method Details
#delimit ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/xcode/project/config/io_scanner.rb', line 25 def delimit @term = '' while c = @io.getc return c if DELIMS.include? c term << c end return nil end |
#tokenize ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/xcode/project/config/io_scanner.rb', line 14 def tokenize @term = '' while c = @io.getc return c if TOKENS.include? c term << c end return nil end |