Class: Rabbit::Parser::Image
- Includes:
- Element
- Defined in:
- lib/rabbit/parser/image.rb
Constant Summary
Constants included from ModuleLoader
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Methods included from ModuleLoader
extend_object, #find_loader, #loaders, #push_loader, #unshift_loader
Constructor Details
This class inherits a constructor from Rabbit::Parser::Base
Class Method Details
.match?(source) ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rabbit/parser/image.rb', line 13 def match?(source) = { :prefix => "image-parser-match", :source => source, } Rabbit::TemporaryFile.create() do |input| begin Rabbit::ImageLoader.new(input.path) true rescue Rabbit::ImageLoadError false end end end |
Instance Method Details
#parse ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rabbit/parser/image.rb', line 30 def parse = { :prefix => "image-parser-parse", :source => @source, } TemporaryFile.create() do |image| @image = image @canvas << ImageTitleSlide.new(@image.path) end end |