class ImageMagick::Identify

Constants

VERSION

Public Class Methods

for(file_path) click to toggle source
# File lib/imagemagick/identify.rb, line 16
def for(file_path)
  new(file_path)
end

Private Class Methods

new(file_path) click to toggle source
# File lib/imagemagick/identify.rb, line 10
def initialize(file_path)
  @file_path = file_path
  validate_file_path!
end

Public Instance Methods

run() click to toggle source
# File lib/imagemagick/identify.rb, line 23
def run
  output = command.execute(@file_path)
  parsed_result = parser.parse(output)
  Result.new(parsed_result)
end

Private Instance Methods

command() click to toggle source
# File lib/imagemagick/identify.rb, line 31
def command
  ImageMagick::Identify::Command
end
parser() click to toggle source
# File lib/imagemagick/identify.rb, line 35
def parser
  ImageMagick::Identify::Parser
end
validate_file_path!() click to toggle source
# File lib/imagemagick/identify.rb, line 39
def validate_file_path!
  raise FileNotFoundException, "File doesn't exist!" unless File.exists?(@file_path)
end