Class: OpenTaxFormFiller::Definitions

Inherits:
Object
  • Object
show all
Extended by:
GenericJsons::Assertions::ClassMethods, GenericJsons::ClassMethods, NoDB::ClassMethods
Includes:
GenericJsons, GenericJsons::Assertions, NoDB, Constants, Examples
Defined in:
app/models/open_tax_form_filler.rb

Overview

Constants

Defined Under Namespace

Modules: Constants, Examples

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

Constants included from Examples

Examples::All, Examples::Simple_acquisition

Constants included from Constants

Constants::Input_filenames, Constants::OTF_SQL_dump_filename, Constants::Open_tax_filler_directory

Constants included from Constants

Constants::Data_source_directory, Constants::Default_tax_year

Constants included from NoDB

NoDB::DEFAULT_TYPE

Constants included from GenericTableAssociation::Examples

GenericTableAssociation::Examples::First_stream_method

Instance Attribute Summary

Attributes included from NoDB

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods included from GenericJsons::Assertions::ClassMethods

assert_json_string, assert_post_conditions, assert_pre_conditions

Methods included from GenericJsons::ClassMethods

coarse_filter, coarse_rejections, fine_rejections

Methods included from GenericFiles::ClassMethods

#all_initialize, #dump_sql_to_file, #raw_acquisitions

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

Methods included from GenericJsons::Assertions

#assert_post_conditions, #assert_pre_conditions

Methods included from GenericFiles::Assertions::ClassMethods

#assert_post_conditions, #assert_pre_conditions

Methods included from GenericFiles::Assertions

#assert_post_conditions, #assert_pre_conditions

Methods included from NoDB

#[], #[]=, #clone, #each_pair, #has_key?, #initialize, #insert_sql, #keys, #table_class, #table_name

Methods included from Generic_Table

activeRecordTableNotCreatedYet?, classDefiniton, classReference, class_of_name, eval_constant, is_ActiveRecord_table?, is_generic_table?, is_generic_table_name?, is_table?, rails_MVC_class?, rubyClassName, table_exists?

Methods included from GenericTableAssociation

#associated_foreign_key_records, #associated_to_s, #association_class, #association_has_data, #association_state, #foreign_key_points_to_me?, #foreign_key_to_association, #foreign_key_value, #logical_primary_key_recursive_value, #logical_primary_key_value, #name_to_association

Methods included from GenericTableAssociation::Assertions::ClassMethods

#assert_foreign_keys_not_nil, #assert_invariant, #assert_post_conditions, #assert_pre_conditions

Methods included from GenericTableAssociation::Assertions

#assert_associated_foreign_key, #assert_associated_foreign_key_name, #assert_association, #assert_association_methods, #assert_association_to_many, #assert_association_to_one, #assert_foreign_key_association_names, #assert_foreign_key_name, #assert_foreign_key_not_nil, #assert_foreign_keys_not_nil, #assert_invariant, #assert_post_conditions, #assert_pre_conditions

Methods included from GenericTableHtml

#column_html, #rails_route, #row_html

Class Method Details

.allObject

parse


52
53
54
# File 'app/models/open_tax_form_filler.rb', line 52

def self.all
	All
end

.input_file_namesObject


30
31
32
# File 'app/models/open_tax_form_filler.rb', line 30

def self.input_file_names
	Input_filenames
end

.parseObject

returns array of hashes


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'app/models/open_tax_form_filler.rb', line 37

def self.parse
	coarse= raw_acquisitions.map do |acquisition|
		json=JSON[acquisition]
		entries=[]
		json['fields'].each_pair do |key, value|
			flat={}
			flat[:form]=json['form']
			flat[:year]=json['year']
			flat[:line]=key
			flat[:type]=value
			entries.push(flat)
		end #each_pair
		entries
	end.flatten #map
end

Instance Method Details

#table_name?Boolean

input_file_names

Returns:

  • (Boolean)

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

def table_name?
	'Definitions'
end