Class: FLACsmith::Metadata::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/flacsmith/metadata/image.rb

Overview

Represents metadata image information.

Instance Method Summary collapse

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

#dimensionsObject



15
16
17
# File 'lib/flacsmith/metadata/image.rb', line 15

def dimensions
  ""
end

#exist?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/flacsmith/metadata/image.rb', line 19

def exist?
  ::File.exist? path
end

#to_sObject 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