Module: GenericFiles::ClassMethods

Constant Summary

Constants included from ColumnGroup::ClassMethods

ColumnGroup::ClassMethods::History_columns

Constants included from GenericGrep::ClassMethods

GenericGrep::ClassMethods::ASSOCIATION_MACRO_LETTERS, GenericGrep::ClassMethods::ASSOCIATION_MACRO_PATTERN

Instance Method Summary collapse

Methods included from NoDB::ClassMethods

#column_symbols, #data_source_yaml, #default_names, #dump, #get_field_names, #insert_sql, #table_class, #table_name

Methods included from Generic_Table::ClassMethods

#is_active_record_method?, #model_file_name, #nesting, #one_pass_statistics, #sample, #sample_burst

Methods included from ColumnGroup::ClassMethods

#attribute_ddl, #attribute_rails_type, #attribute_ruby_type, #candidate_logical_keys_from_indexes, #categorical?, #column_symbols, #default_logical_primary_key, #defaulted_primary_logical_key?, #history_type?, #is_logical_primary_key?, #logical_attributes, #logical_primary_key, #logical_primary_key_recursive, #numerical?, #probably_categorical?, #probably_numerical?, #sequential_id?

Methods included from GenericGrep::ClassMethods

#all_associations, #association_grep, #association_grep_pattern, #association_macro_type, #association_type, #belongs_to_association?, #grep_all_associations_command, #grep_command, #has_many_association?, #has_one_association?, #model_grep, #model_grep_command

Methods included from GenericTableHtml::ClassMethods

#column_order, #header_html, #table_html

Instance Method Details

#all_initializeObject

return Array of class


27
28
29
30
31
32
# File 'app/models/generic_file.rb', line 27

def all_initialize
	parse.map do |hash|
#		model_class?.new(parse(hash), [String, Fixnum, String, String])
		new(hash, [String, Fixnum, String, String])
	end #map
end

#dump_sql_to_file(filename = "#{Data_source_directory}/#{self.name}_#{Default_tax_year}.sql") ⇒ Object

all_initialize


33
34
35
# File 'app/models/generic_file.rb', line 33

def dump_sql_to_file(filename="#{Data_source_directory}/#{self.name}_#{Default_tax_year}.sql")
		IO.binwrite(filename, dump.join(''))
end

#raw_acquisitionsObject

model_name?


20
21
22
23
24
25
# File 'app/models/generic_file.rb', line 20

def raw_acquisitions #acquisition=next
	all_files=Dir[input_file_names]
	all_files.map do |filename|
		IO.read(filename)
	end.flatten # map no arrays by filename
end

#table_name?Boolean

use for filenaming

Returns:

  • (Boolean)

17
18
19
# File 'app/models/generic_file.rb', line 17

def table_name?
	self.class.name.tableize
end