lib/repla/repl/lib/input_controller.rb in repla-0.4.0 vs lib/repla/repl/lib/input_controller.rb in repla-0.5.0
- old
+ new
@@ -1,18 +1,17 @@
-module Repla::REPL
- class InputController < Repla::Controller
+module Repla
+ module REPL
+ # Input controller
+ class InputController < Repla::Controller
+ attr_accessor :view
+ def initialize(view)
+ @view = view
+ end
- attr_accessor :view
- def initialize(view)
- @view = view
- end
-
- def parse_input(input)
- input = input.dup
- input.chomp!
- if !input.strip.empty? # Ignore empty lines
- @view.add_input(input)
+ def parse_input(input)
+ input = input.dup
+ input.chomp!
+ @view.add_input(input) unless input.strip.empty? # Ignore empty lines
end
end
-
end
end