Class: Rink::Lexer
- Extended by:
- Delegation
- Defined in:
- lib/rink/lexer.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(output = nil) ⇒ Lexer
constructor
A new instance of Lexer.
-
#set_prompt(p = nil, &block) ⇒ Object
RubyLex prompts unconditionally once the prompt is first set (not very reset-friendly), so we need to fix that.
Methods included from Delegation
Constructor Details
#initialize(output = nil) ⇒ Lexer
Returns a new instance of Lexer.
9 10 11 12 |
# File 'lib/rink/lexer.rb', line 9 def initialize(output = nil) @output = output super() end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
6 7 8 |
# File 'lib/rink/lexer.rb', line 6 def output @output end |
Instance Method Details
#set_prompt(p = nil, &block) ⇒ Object
RubyLex prompts unconditionally once the prompt is first set (not very reset-friendly), so we need to fix that.
15 16 17 18 19 20 21 |
# File 'lib/rink/lexer.rb', line 15 def set_prompt(p = nil, &block) if p.nil? && !block_given? @prompt = nil # this will go back to NOT prompting else super end end |