lib/how_is/report.rb in how_is-18.0.3 vs lib/how_is/report.rb in how_is-18.0.4
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'date'
require "pathname"
class HowIs
class UnsupportedExportFormat < StandardError
@@ -61,17 +63,17 @@
report_format = infer_format(file)
report.public_send("to_#{report_format}")
end
- private
# Given a format name (+format+), returns the corresponding <blah>Report
# class.
def self.get_report_class(format)
class_name = "#{format.capitalize}Report"
raise UnsupportedExportFormat, format unless HowIs.const_defined?(class_name)
HowIs.const_get(class_name)
end
+ private_class_method :get_report_class
end
end