Module: EasyExports

Defined in:
lib/easy_exports.rb,
lib/easy_exports/export.rb,
lib/easy_exports/railtie.rb,
lib/easy_exports/version.rb,
lib/easy_exports/data_loader.rb,
lib/easy_exports/exports_generable.rb,
lib/easy_exports/exportable_attributes.rb,
lib/easy_exports/data_attributes_resolver.rb,
lib/easy_exports/exportable_attribute_resolvers.rb,
lib/easy_exports/exclude_associations_configurations.rb,
lib/easy_exports/exclude_exportable_attributes_configurations.rb,
lib/easy_exports/exportable_association_aliases_configurations.rb,
lib/easy_exports/exportable_attribute_formatters_configurations.rb

Defined Under Namespace

Modules: DataAttributesResolver, DataLoader, ExcludeAssociationsConfigurations, ExcludeExportableAttributesConfigurations, ExportableAssociationAliasesConfigurations, ExportableAttributeFormattersConfigurations, ExportableAttributeResolvers, ExportableAttributes, ExportsGenerable Classes: Export, Railtie

Constant Summary collapse

DEFAULT_BATCH_SIZE =
1_000
DEFAULT_SENSITIVE_ATTRIBUTES =
%w[
  password_digest
  encrypted_password
  remember_token
  reset_password_token
  confirmation_token
  session_token
  api_key
  secret_token
].freeze
TYPE_MATCHERS =
{
  boolean: ->(v) { v == true || v == false },
  datetime: ->(v) { v.is_a?(Date) || v.is_a?(Time) || v.is_a?(DateTime) || v.is_a?(ActiveSupport::TimeWithZone) },
  leading_zero_string: ->(v) { v.is_a?(String) && v.start_with?('0') },
  string: ->(v) { v.is_a?(String) && !v.include?('@') }
}.freeze
TYPE_FORMATTERS =
{
  boolean: ->(v) { v ? 'Yes' : 'No' },
  datetime: ->(v) { v.strftime('%A, %B %-d, %Y %H:%M') },
  leading_zero_string: ->(v) { "'#{v}" }
}.freeze
DEFAULT_CSV_HEADER_FORMATTER =
->(key) { key.to_s.humanize.titleize }
VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (EasyExports)

    the object that the method was called on



51
52
53
# File 'lib/easy_exports.rb', line 51

def self.configure
  yield self
end