Sha256: bb61f6695e4f0fc0419866e9f24266047a9bdc642ea1e8e8ba92015f91bd76ea
Contents?: true
Size: 992 Bytes
Versions: 4
Compression:
Stored size: 992 Bytes
Contents
# require "eitil_integrate/application_exporter/lookups" require "eitil_integrate/application_exporter/initialize" require "eitil_support/directory" module EitilIntegrate::RubyXL class ApplicationExporter class << self def exporter_paths EitilSupport::Directory.files('app/exporters/exporters').select { |path| path.end_with? '_exporter.rb' } end def exporter_names exporter_paths.map { |path| path.split('/').last.remove('.rb').camelcase } end def exporter_constants exporter_names.map &:constantize end def exporter_infos exporter_constants.map { |_c| { "#{_c}": _c.info || {} } }.inject &:merge end alias_method :taxonomy, :exporter_infos def exporter_info(exporter, info) exporter_infos[exporter]&.dig(info) end def exporter_params exporter_infos.transform_values { |v| [v[:required], v[:optional]].flatten.compact } end end end end
Version data entries
4 entries across 4 versions & 1 rubygems