class FLACsmith::Metadata::Image

Represents metadata image information.

Attributes

description[R]
path[R]
type[R]

Public Class Methods

new(path, type: 3, description: "Cover") click to toggle source
# File lib/flacsmith/metadata/image.rb, line 9
def initialize path, type: 3, description: "Cover"
  @path = compute_path path
  @type = type
  @description = description
end

Public Instance Methods

dimensions() click to toggle source
# File lib/flacsmith/metadata/image.rb, line 15
def dimensions
  ""
end
exist?() click to toggle source
# File lib/flacsmith/metadata/image.rb, line 19
def exist?
  ::File.exist? path
end
to_s() click to toggle source
# File lib/flacsmith/metadata/image.rb, line 23
def to_s
  return "" unless exist?

  [type, "image/jpeg", description, dimensions, path].join "|"
end
Also aliased as: to_str
to_str()
Alias for: to_s

Private Instance Methods

compute_path(path) click to toggle source
# File lib/flacsmith/metadata/image.rb, line 35
def compute_path path
  return "" if String(path).empty?

  Shellwords.escape path
end