Class: FileConvert::File
- Inherits:
-
Object
- Object
- FileConvert::File
- Defined in:
- lib/file_convert/file.rb
Instance Attribute Summary collapse
-
#conversions ⇒ Object
readonly
Returns the value of attribute conversions.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#original_file ⇒ Object
readonly
Returns the value of attribute original_file.
Instance Method Summary collapse
-
#add_conversion(mime_type, converted_file) ⇒ FileConvert::File
Adds a new conversion.
-
#initialize(original_file) ⇒ FileConvert::File
constructor
Hold original and conversion.
Constructor Details
#initialize(original_file) ⇒ FileConvert::File
Hold original and conversion
13 14 15 16 17 |
# File 'lib/file_convert/file.rb', line 13 def initialize(original_file) @original_file = original_file @data = original_file.data @conversions = {} end |
Instance Attribute Details
#conversions ⇒ Object (readonly)
Returns the value of attribute conversions.
5 6 7 |
# File 'lib/file_convert/file.rb', line 5 def conversions @conversions end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/file_convert/file.rb', line 4 def data @data end |
#original_file ⇒ Object (readonly)
Returns the value of attribute original_file.
3 4 5 |
# File 'lib/file_convert/file.rb', line 3 def original_file @original_file end |
Instance Method Details
#add_conversion(mime_type, converted_file) ⇒ FileConvert::File
Adds a new conversion
26 27 28 |
# File 'lib/file_convert/file.rb', line 26 def add_conversion(mime_type, converted_file) tap { @conversions[mime_type] = converted_file } end |