Class: Omnizip::Converter::ConversionStrategy
- Inherits:
-
Object
- Object
- Omnizip::Converter::ConversionStrategy
- Defined in:
- lib/omnizip/converter/conversion_strategy.rb
Overview
Base class for archive format conversion strategies
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
-
#target_path ⇒ Object
readonly
Returns the value of attribute target_path.
Class Method Summary collapse
-
.can_convert?(_source, _target) ⇒ Boolean
Check if this strategy can handle the conversion.
Instance Method Summary collapse
-
#convert ⇒ ConversionResult
Perform the conversion.
-
#initialize(source_path, target_path, options) ⇒ ConversionStrategy
constructor
Initialize conversion strategy.
-
#source_format ⇒ Symbol
Get source format.
-
#target_format ⇒ Symbol
Get target format.
Constructor Details
#initialize(source_path, target_path, options) ⇒ ConversionStrategy
Initialize conversion strategy
13 14 15 16 17 18 |
# File 'lib/omnizip/converter/conversion_strategy.rb', line 13 def initialize(source_path, target_path, ) @source_path = source_path @target_path = target_path @options = @warnings = [] end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/omnizip/converter/conversion_strategy.rb', line 7 def @options end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
7 8 9 |
# File 'lib/omnizip/converter/conversion_strategy.rb', line 7 def source_path @source_path end |
#target_path ⇒ Object (readonly)
Returns the value of attribute target_path.
7 8 9 |
# File 'lib/omnizip/converter/conversion_strategy.rb', line 7 def target_path @target_path end |
Class Method Details
.can_convert?(_source, _target) ⇒ Boolean
Check if this strategy can handle the conversion
45 46 47 |
# File 'lib/omnizip/converter/conversion_strategy.rb', line 45 def self.can_convert?(_source, _target) false end |
Instance Method Details
#convert ⇒ ConversionResult
Perform the conversion
23 24 25 |
# File 'lib/omnizip/converter/conversion_strategy.rb', line 23 def convert raise NotImplementedError, "#{self.class} must implement #convert" end |
#source_format ⇒ Symbol
Get source format
30 31 32 |
# File 'lib/omnizip/converter/conversion_strategy.rb', line 30 def source_format raise NotImplementedError, "#{self.class} must implement #source_format" end |
#target_format ⇒ Symbol
Get target format
37 38 39 |
# File 'lib/omnizip/converter/conversion_strategy.rb', line 37 def target_format raise NotImplementedError, "#{self.class} must implement #target_format" end |