lib/eddy/data/persistence/memory.rb in eddy-0.8.4 vs lib/eddy/data/persistence/memory.rb in eddy-0.9.0

- old
+ new

@@ -10,10 +10,20 @@ interchange_control_numbers: [], transaction_set_control_numbers: {}, } end + # Clear persisted data. + # + # @return [void] + def reset() + @data = { + interchange_control_numbers: [], + transaction_set_control_numbers: {}, + } + end + # @return [Array<Integer>] def interchange_control_numbers() return @data[:interchange_control_numbers] end @@ -25,21 +35,21 @@ end return @data[:transaction_set_control_numbers][transaction_set_id] end # @param new_ctrl_num [Integer] - # @return [void] + # @return [Array<Integer>] def add_interchange_control_number(new_ctrl_num) self.interchange_control_numbers.append(new_ctrl_num) - return nil + return self.interchange_control_numbers() end # @param transaction_set_id [String] # @param new_ctrl_num [Integer] - # @return [void] + # @return [Array<Integer>] def add_transaction_set_control_number(transaction_set_id, new_ctrl_num) self.transaction_set_control_numbers(transaction_set_id).append(new_ctrl_num) - return nil + return self.transaction_set_control_numbers(transaction_set_id) end end end end