Class: FLACsmith::Metadata::Image
- Inherits:
-
Object
- Object
- FLACsmith::Metadata::Image
- Defined in:
- lib/flacsmith/metadata/image.rb
Overview
Represents metadata image information.
Instance Method Summary collapse
- #dimensions ⇒ Object
- #exist? ⇒ Boolean
-
#initialize(path, type: 3, description: "Cover") ⇒ Image
constructor
A new instance of Image.
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(path, type: 3, description: "Cover") ⇒ Image
Returns a new instance of Image.
9 10 11 12 13 |
# File 'lib/flacsmith/metadata/image.rb', line 9 def initialize path, type: 3, description: "Cover" @path = compute_path path @type = type @description = description end |
Instance Method Details
#dimensions ⇒ Object
15 16 17 |
# File 'lib/flacsmith/metadata/image.rb', line 15 def dimensions "" end |
#exist? ⇒ Boolean
19 20 21 |
# File 'lib/flacsmith/metadata/image.rb', line 19 def exist? ::File.exist? path end |
#to_s ⇒ Object Also known as: to_str
23 24 25 26 27 |
# File 'lib/flacsmith/metadata/image.rb', line 23 def to_s return "" unless exist? [type, "image/jpeg", description, dimensions, path].join "|" end |