Class: Repla::REPL::InputController
- Inherits:
-
Controller
- Object
- Controller
- Repla::REPL::InputController
- Defined in:
- lib/repla/repl/lib/input_controller.rb
Overview
Input controller
Instance Attribute Summary collapse
-
#view ⇒ Object
Returns the value of attribute view.
Instance Method Summary collapse
-
#initialize(view) ⇒ InputController
constructor
A new instance of InputController.
- #parse_input(input) ⇒ Object
Constructor Details
#initialize(view) ⇒ InputController
Returns a new instance of InputController.
6 7 8 |
# File 'lib/repla/repl/lib/input_controller.rb', line 6 def initialize(view) @view = view end |
Instance Attribute Details
#view ⇒ Object
Returns the value of attribute view.
5 6 7 |
# File 'lib/repla/repl/lib/input_controller.rb', line 5 def view @view end |
Instance Method Details
#parse_input(input) ⇒ Object
10 11 12 13 14 |
# File 'lib/repla/repl/lib/input_controller.rb', line 10 def parse_input(input) input = input.dup input.chomp! @view.add_input(input) unless input.strip.empty? # Ignore empty lines end |