Module: Gammo::Tokenizer::Debug::ClassMethods
- Defined in:
- lib/gammo/tokenizer/debug.rb
Instance Method Summary collapse
Instance Method Details
#map ⇒ Object
28 29 30 |
# File 'lib/gammo/tokenizer/debug.rb', line 28 def map @map ||= {} end |
#method_added(method) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gammo/tokenizer/debug.rb', line 13 def method_added(method) name = method.to_s return if %w[debug _debugged ?].any?(&name.method(:end_with?)) return unless name.start_with?('scan_') return if map[method] map[method] = true alias_method :"#{name}_debugged", method class_eval <<-EOS def #{method} debug "#{method}, \#{scanner.string[scanner.pos]}" #{method}_debugged end EOS end |