Class: DwcaHunter::ResourceFishbase

Inherits:
Resource
  • Object
show all
Defined in:
lib/dwca_hunter/resources/fishbase.rb

Overview

Resource for FishBase

Instance Attribute Summary collapse

Attributes inherited from Resource

#command, #download_path, #url, #uuid

Instance Method Summary collapse

Methods inherited from Resource

gunzip, #needs_download?, #needs_unpack?, unzip

Constructor Details

#initialize(opts = {}) ⇒ ResourceFishbase

Returns a new instance of ResourceFishbase.



5
6
7
8
9
10
11
12
13
14
# File 'lib/dwca_hunter/resources/fishbase.rb', line 5

def initialize(opts = {})
  @command = "fishbase"
  @title = "FishBase Cache"
  @abbr = "FishBase Cache"
  @uuid = "bacd21f0-44e0-43e2-914c-70929916f257"
  @download_path = File.join(Dir.tmpdir, "dwca_hunter", "fishbase",
                             "fishbase.tsv")
  @extensions = []
  super
end

Instance Attribute Details

#abbrObject (readonly)

Returns the value of attribute abbr.



4
5
6
# File 'lib/dwca_hunter/resources/fishbase.rb', line 4

def abbr
  @abbr
end

#titleObject (readonly)

Returns the value of attribute title.



4
5
6
# File 'lib/dwca_hunter/resources/fishbase.rb', line 4

def title
  @title
end

Instance Method Details

#downloadObject



16
17
18
19
# File 'lib/dwca_hunter/resources/fishbase.rb', line 16

def download
  FileUtils.cp(File.join(__dir__, "..", "..", "files",
                         "fishbase_taxon_cache.tsv"), @download_path)
end

#make_dwcaObject



24
25
26
27
# File 'lib/dwca_hunter/resources/fishbase.rb', line 24

def make_dwca
  organize_data
  generate_dwca
end

#unpackObject



21
22
# File 'lib/dwca_hunter/resources/fishbase.rb', line 21

def unpack
end