Class: DarwinCore::Generator::MetaXml
- Inherits:
-
Object
- Object
- DarwinCore::Generator::MetaXml
- Defined in:
- lib/dwc-archive/generator_meta_xml.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(data, path) ⇒ MetaXml
constructor
A new instance of MetaXml.
Constructor Details
#initialize(data, path) ⇒ MetaXml
Returns a new instance of MetaXml.
4 5 6 7 8 |
# File 'lib/dwc-archive/generator_meta_xml.rb', line 4 def initialize(data, path) @data = data @path = path @write = 'w:utf-8' end |
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/dwc-archive/generator_meta_xml.rb', line 10 def create schema_uri = 'http://rs.tdwg.org/dwc/terms/xsd/archive/' + ' http://darwincore.googlecode.com/svn/trunk/text/tdwg_dwc_text.xsd' builder = Nokogiri::XML::Builder.new do |xml| opts = { encoding: 'UTF-8', fieldsTerminatedBy: ',', fieldsEnclosedBy: '"', linesTerminatedBy: "\n", rowType: 'http://rs.tdwg.org/dwc/terms/Taxon' } build_archive(xml, opts, schema_uri) end = builder.to_xml = open(File.join(@path, 'meta.xml'), @write) .write() .close end |