Class: ImageMagick::Identify

Inherits:
Object
  • Object
show all
Defined in:
lib/imagemagick/identify.rb,
lib/imagemagick/identify/version.rb

Defined Under Namespace

Modules: Command, Parser Classes: Result

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ Identify

Returns a new instance of Identify.



10
11
12
13
# File 'lib/imagemagick/identify.rb', line 10

def initialize(file_path)
  @file_path = file_path
  validate_file_path!
end

Class Method Details

.for(file_path) ⇒ Object



16
17
18
# File 'lib/imagemagick/identify.rb', line 16

def for(file_path)
  new(file_path)
end

Instance Method Details

#runObject



23
24
25
26
27
# File 'lib/imagemagick/identify.rb', line 23

def run
  output = command.execute(@file_path)
  parsed_result = parser.parse(output)
  Result.new(parsed_result)
end