Class: SMPTool::VirtualVolume::Utils::FileExtracter
- Inherits:
-
Object
- Object
- SMPTool::VirtualVolume::Utils::FileExtracter
- Defined in:
- lib/smp_tool/virtual_volume/utils/file_extracter.rb
Overview
Extracts files.
Instance Method Summary collapse
-
#f_extract_raw(file_id) ⇒ FileInterface
Extract file as is.
-
#f_extract_txt(file_id) {|str| ... } ⇒ FileInterface
Extract file as array of strings.
-
#initialize(data) ⇒ FileExtracter
constructor
A new instance of FileExtracter.
Constructor Details
#initialize(data) ⇒ FileExtracter
Returns a new instance of FileExtracter.
10 11 12 |
# File 'lib/smp_tool/virtual_volume/utils/file_extracter.rb', line 10 def initialize(data) @data = data.reject { |e| e.status == EMPTY_ENTRY } end |
Instance Method Details
#f_extract_raw(file_id) ⇒ FileInterface
Extract file as is.
21 22 23 24 25 26 |
# File 'lib/smp_tool/virtual_volume/utils/file_extracter.rb', line 21 def f_extract_raw(file_id) FileInterface.new( filename: file_id.print_ascii, data: _extract_raw_data(file_id) ) end |
#f_extract_txt(file_id) {|str| ... } ⇒ FileInterface
Extract file as array of strings.
37 38 39 40 41 42 |
# File 'lib/smp_tool/virtual_volume/utils/file_extracter.rb', line 37 def f_extract_txt(file_id, &block) FileInterface.new( filename: file_id.print_ascii, data: _text_data(file_id, &block) ) end |