Class: CsvImportAnalyzer::MetadataAnalysis
- Inherits:
-
Object
- Object
- CsvImportAnalyzer::MetadataAnalysis
- Defined in:
- lib/csv-import-analyzer/export/metadata_analysis.rb
Instance Attribute Summary collapse
-
#max_distinct_values ⇒ Object
Returns the value of attribute max_distinct_values.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
Instance Method Summary collapse
- #create_queries ⇒ Object
- #databases ⇒ Object
- #header_datatype_analysis ⇒ Object
- #header_datatypes ⇒ Object
- #import_queries ⇒ Object
-
#initialize(options) ⇒ MetadataAnalysis
constructor
A new instance of MetadataAnalysis.
-
#metadata_print ⇒ Object
Builds the metadata from the analysis done so far Creates a new json file with the analysis added to it if options is set returns JSON object of the metadata.
- #nullable_columns ⇒ Object
- #options ⇒ Object
- #unique_values ⇒ Object
Constructor Details
#initialize(options) ⇒ MetadataAnalysis
Returns a new instance of MetadataAnalysis.
5 6 7 8 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 5 def initialize() = = {} end |
Instance Attribute Details
#max_distinct_values ⇒ Object
Returns the value of attribute max_distinct_values.
4 5 6 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 4 def max_distinct_values @max_distinct_values end |
#metadata ⇒ Object
Returns the value of attribute metadata.
4 5 6 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 4 def end |
Instance Method Details
#create_queries ⇒ Object
34 35 36 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 34 def create_queries [:create_query] end |
#databases ⇒ Object
30 31 32 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 30 def databases [:database] end |
#header_datatype_analysis ⇒ Object
22 23 24 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 22 def header_datatype_analysis [:csv_datatype_analysis] end |
#header_datatypes ⇒ Object
18 19 20 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 18 def header_datatypes [:csv_column_datatypes] end |
#import_queries ⇒ Object
38 39 40 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 38 def import_queries [:import_query] end |
#metadata_print ⇒ Object
Builds the metadata from the analysis done so far Creates a new json file with the analysis added to it if options is set returns JSON object of the metadata
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 55 def if [:metadata_output] if [:out_format] == :json json_print_to_file end if [:out_format] == :csv csv_print_to_file end end return JSON.pretty_generate() end |
#nullable_columns ⇒ Object
26 27 28 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 26 def nullable_columns [:nullable] end |
#options ⇒ Object
10 11 12 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 10 def end |
#unique_values ⇒ Object
42 43 44 |
# File 'lib/csv-import-analyzer/export/metadata_analysis.rb', line 42 def unique_values [:uniques] end |