Class: Taxonifi::Export::Prolog
- Defined in:
- lib/taxonifi/export/format/prolog.rb
Overview
Dumps tables identical to the existing structure in SpeciesFile. Will only work in the pre Identity world. Will reconfigure as templates for Jim’s work after the fact.
Constant Summary
Constants inherited from Base
Base::EXPORT_BASE, Base::TAXRANKS
Instance Attribute Summary collapse
-
#author_index ⇒ Object
Returns the value of attribute author_index.
-
#authorized_user_id ⇒ Object
Returns the value of attribute authorized_user_id.
-
#genus_names ⇒ Object
Returns the value of attribute genus_names.
-
#name_collection ⇒ Object
Returns the value of attribute name_collection.
-
#nomenclator ⇒ Object
Returns the value of attribute nomenclator.
-
#pub_collection ⇒ Object
Returns the value of attribute pub_collection.
-
#ref_collection ⇒ Object
Returns the value of attribute ref_collection.
-
#species_names ⇒ Object
Returns the value of attribute species_names.
-
#starting_ref_id ⇒ Object
Returns the value of attribute starting_ref_id.
-
#time ⇒ Object
Returns the value of attribute time.
Attributes inherited from Base
#base_export_path, #export_folder
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize(options = {}) ⇒ Prolog
constructor
A new instance of Prolog.
Methods inherited from Base
#configure_folders, #export_path, #new_output_file, #sanitize, #sql_insert_statement, #sqlize, #write_file
Constructor Details
#initialize(options = {}) ⇒ Prolog
Returns a new instance of Prolog.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/taxonifi/export/format/prolog.rb', line 16 def initialize( = {}) opts = { :nc => Taxonifi::Model::NameCollection.new, :export_folder => 'prolog', :starting_ref_id => 1, # should be configured elsewhere... but :manifest => %w{tblPubs tblRefs tblPeople tblRefAuthors tblTaxa tblGenusNames tblSpeciesNames tblNomenclator tblCites} }.merge!() @manifest = opts[:manifest] super(opts) raise Taxonifi::Export::ExportError, 'NameCollection not passed to SpeciesFile export.' if ! opts[:nc].class == Taxonifi::Model::NameCollection # raise Taxonifi::Export::ExportError, 'You must provide authorized_user_id for species_file export initialization.' if opts[:authorized_user_id].nil? # @name_collection = opts[:nc] # @pub_collection = {} # title => id # @authorized_user_id = opts[:authorized_user_id] # @author_index = {} # @starting_ref_id = opts[:starting_ref_id] # # # Careful here, at present we are just generating Reference micro-citations from our names, so the indexing "just works" # # because it's all internal. There will is a strong potential for key collisions if this pipeline is modified to # # include references external to the initialized name_collection. See also export_references. # # # # @by_author_reference_index = {} # @genus_names = {} # @species_names = {} # @nomenclator = {} @time = Time.now.strftime("%F %T") @empty_quotes = "" end |
Instance Attribute Details
#author_index ⇒ Object
Returns the value of attribute author_index.
11 12 13 |
# File 'lib/taxonifi/export/format/prolog.rb', line 11 def @author_index end |
#authorized_user_id ⇒ Object
Returns the value of attribute authorized_user_id.
13 14 15 |
# File 'lib/taxonifi/export/format/prolog.rb', line 13 def @authorized_user_id end |
#genus_names ⇒ Object
Returns the value of attribute genus_names.
12 13 14 |
# File 'lib/taxonifi/export/format/prolog.rb', line 12 def genus_names @genus_names end |
#name_collection ⇒ Object
Returns the value of attribute name_collection.
8 9 10 |
# File 'lib/taxonifi/export/format/prolog.rb', line 8 def name_collection @name_collection end |
#nomenclator ⇒ Object
Returns the value of attribute nomenclator.
12 13 14 |
# File 'lib/taxonifi/export/format/prolog.rb', line 12 def nomenclator @nomenclator end |
#pub_collection ⇒ Object
Returns the value of attribute pub_collection.
10 11 12 |
# File 'lib/taxonifi/export/format/prolog.rb', line 10 def pub_collection @pub_collection end |
#ref_collection ⇒ Object
Returns the value of attribute ref_collection.
9 10 11 |
# File 'lib/taxonifi/export/format/prolog.rb', line 9 def ref_collection @ref_collection end |
#species_names ⇒ Object
Returns the value of attribute species_names.
12 13 14 |
# File 'lib/taxonifi/export/format/prolog.rb', line 12 def species_names @species_names end |
#starting_ref_id ⇒ Object
Returns the value of attribute starting_ref_id.
14 15 16 |
# File 'lib/taxonifi/export/format/prolog.rb', line 14 def starting_ref_id @starting_ref_id end |
#time ⇒ Object
Returns the value of attribute time.
13 14 15 |
# File 'lib/taxonifi/export/format/prolog.rb', line 13 def time @time end |
Instance Method Details
#export ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/taxonifi/export/format/prolog.rb', line 48 def export() super configure_folders str = ["FOO"] write_file('foo.pl', str.join("\n\n")) true end |