Class: Gm::Notepad::InputHandlers::WriteLineHandler
- Inherits:
-
DefaultHandler
- Object
- DefaultHandler
- Gm::Notepad::InputHandlers::WriteLineHandler
- Defined in:
- lib/gm/notepad/input_handlers/write_line_handler.rb
Constant Summary collapse
- NON_EXPANDING_CHARATER =
'!'.freeze
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from DefaultHandler
build_if_handled, #initialize, #lines
Constructor Details
This class inherits a constructor from Gm::Notepad::InputHandlers::DefaultHandler
Class Method Details
.handles?(input:) ⇒ Boolean
8 9 10 |
# File 'lib/gm/notepad/input_handlers/write_line_handler.rb', line 8 def self.handles?(input:) true end |
Instance Method Details
#after_initialize! ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/gm/notepad/input_handlers/write_line_handler.rb', line 12 def after_initialize! if input[0] == NON_EXPANDING_CHARATER input.sub!(/^\!/,'') = false else = true end input.render_current_text(to_interactive: true, to_output: true, expand_line: ) end |