Module: ImageSpec::Parser
- Defined in:
- lib/parser.rb,
lib/parser/gif.rb,
lib/parser/png.rb,
lib/parser/swf.rb,
lib/parser/jpeg.rb
Defined Under Namespace
Classes: GIF, JPEG, PNG, SWF
Class Method Summary
collapse
Class Method Details
8
9
10
|
# File 'lib/parser.rb', line 8
def self.formats
@@formats ||= constants.collect { |format| const_get(format) }
end
|
.parse(stream) ⇒ Object
12
13
14
15
16
17
|
# File 'lib/parser.rb', line 12
def self.parse(stream)
formats.each do |format|
return format.attributes(stream) if format.detected?(stream)
end
raise Error, "#{stream.inspect} is not a supported image format. Sorry bub :("
end
|