Module: CSVConverter
- Defined in:
- lib/csv_converter.rb,
lib/csv_converter/version.rb,
lib/csv_converter/file_processor.rb,
lib/csv_converter/entity_processor.rb,
lib/csv_converter/attribute_processor.rb,
lib/csv_converter/converters/base_converter.rb,
lib/csv_converter/converters/date_converter.rb,
lib/csv_converter/converters/hash_converter.rb,
lib/csv_converter/converters/array_converter.rb,
lib/csv_converter/converters/float_converter.rb,
lib/csv_converter/converters/string_converter.rb,
lib/csv_converter/converters/boolean_converter.rb,
lib/csv_converter/converters/integer_converter.rb,
lib/csv_converter/converters/lowercase_converter.rb,
lib/csv_converter/converters/uppercase_converter.rb,
lib/csv_converter/converters/big_decimal_converter.rb
Overview
CSVConverter groups and transforms tabulated data contained in files such as csv or spreadsheets.
Defined Under Namespace
Modules: Converters Classes: AttributeProcessor, EntityProcessor, Error, FileProcessor
Constant Summary collapse
- ALIASES =
{ array: 'CSVConverter::Converters::ArrayConverter', boolean: 'CSVConverter::Converters::BooleanConverter', date: 'CSVConverter::Converters::DateConverter', decimal: 'CSVConverter::Converters::BigDecimalConverter', float: 'CSVConverter::Converters::FloatConverter', hash: 'CSVConverter::Converters::HashConverter', integer: 'CSVConverter::Converters::IntegerConverter', lowercase: 'CSVConverter::Converters::LowercaseConverter', string: 'CSVConverter::Converters::StringConverter', uppercase: 'CSVConverter::Converters::UppercaseConverter' }.with_indifferent_access
- VERSION =
'0.1.2'
Class Method Summary collapse
-
.add_alias(new_alias, klass) ⇒ @see #aliases
Adds an alias to the list of aliases.
-
.add_aliases(new_aliases) ⇒ @see #aliases
Adds one or more alieases to the list of aliases.
-
.aliases ⇒ Hash
When no custom aliases are included it returns CSVConverter::ALIASES.
Class Method Details
.add_alias(new_alias, klass) ⇒ @see #aliases
Adds an alias to the list of aliases
73 74 75 |
# File 'lib/csv_converter.rb', line 73 def self.add_alias(new_alias, klass) @aliases = aliases.merge(new_alias.to_sym => klass.to_s) end |
.add_aliases(new_aliases) ⇒ @see #aliases
Adds one or more alieases to the list of aliases
81 82 83 |
# File 'lib/csv_converter.rb', line 81 def self.add_aliases(new_aliases) @aliases = aliases.merge(new_aliases) end |
.aliases ⇒ Hash
When no custom aliases are included it returns CSVConverter::ALIASES. When custom converter alises are included it returns the whole list of aliases.
65 66 67 |
# File 'lib/csv_converter.rb', line 65 def self.aliases @aliases || ALIASES end |