class Holidays::Definition::Generator::Module
def call(module_name, files, regions, month_strings, custom_methods)
def call(module_name, files, regions, month_strings, custom_methods) raise ArgumentError.new("module name cannot be nil") if module_name.nil? raise ArgumentError.new("module name cannot be blank") if module_name.empty? raise ArgumentError.new("files cannot be nil") if files.nil? raise ArgumentError.new("files cannot be empty") if files.empty? raise ArgumentError.new("files must all be strings") unless files.all? { |f| f.is_a?(String) } raise ArgumentError.new("regions cannot be nil") if regions.nil? raise ArgumentError.new("regions cannot be empty") if regions.empty? raise ArgumentError.new("month strings cannot be nil") if month_strings.nil? raise ArgumentError.new("month strings cannot be empty") if month_strings.empty? module_src =<<-EOM ng: utf-8 olidays file is generated by the Ruby Holidays gem. nitions loaded: #{files.join(', ')} the definitions are available at https://github.com/holidays/holidays #{module_name.to_s.upcase} # :nodoc: self.defined_regions #{regions.join(', :')}] self.holidays_by_month #{month_strings.join(",\n")} self.custom_methods #{custom_methods} EOM module_src end