Class: DarwinCore::Archive
- Inherits:
-
Object
- Object
- DarwinCore::Archive
- Defined in:
- lib/dwc_archive/archive.rb
Overview
Deals with handling DarwinCoreArchive file, and provides meta information and files information about archive
Instance Attribute Summary collapse
-
#eml ⇒ Object
readonly
Returns the value of attribute eml.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
Instance Method Summary collapse
- #clean ⇒ Object
- #files ⇒ Object
- #files_path ⇒ Object
-
#initialize(archive_path, tmp_dir) ⇒ Archive
constructor
A new instance of Archive.
- #valid? ⇒ Boolean
Constructor Details
#initialize(archive_path, tmp_dir) ⇒ Archive
Returns a new instance of Archive.
9 10 11 12 13 14 15 |
# File 'lib/dwc_archive/archive.rb', line 9 def initialize(archive_path, tmp_dir) @archive_path = archive_path @tmp_dir = tmp_dir @expander = DarwinCore::Expander.new(@archive_path, @tmp_dir) @expander.unpack end |
Instance Attribute Details
#eml ⇒ Object (readonly)
Returns the value of attribute eml.
7 8 9 |
# File 'lib/dwc_archive/archive.rb', line 7 def eml @eml end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
7 8 9 |
# File 'lib/dwc_archive/archive.rb', line 7 def @meta end |
Instance Method Details
#clean ⇒ Object
31 32 33 |
# File 'lib/dwc_archive/archive.rb', line 31 def clean @expander.clean end |
#files ⇒ Object
23 24 25 |
# File 'lib/dwc_archive/archive.rb', line 23 def files @expander.files end |
#files_path ⇒ Object
27 28 29 |
# File 'lib/dwc_archive/archive.rb', line 27 def files_path @expander.path end |
#valid? ⇒ Boolean
17 18 19 20 21 |
# File 'lib/dwc_archive/archive.rb', line 17 def valid? valid = true valid = valid && @expander.path && FileTest.exist?(@expander.path) valid && files && files.include?("meta.xml") end |