class OrderStringAnalyzer attr_reader :order_string, :employee_recorder def initialize(order_string) @order_string = order_string @employee_recorder = EmployeeRecorder.new @execution_histories = [] end def read_and_execute! @execution_histories = order_string.lines.map do |line| command, *args = line.split employee_recorder.public_send(command, *args) end nil end def execution_histories @execution_histories.compact end end