Class: Fluent::ImageFileOutput
- Inherits:
-
Output
- Object
- Output
- Fluent::ImageFileOutput
- Defined in:
- lib/fluent/plugin/out_imagefile.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #emit(tag, es, chain) ⇒ Object
-
#initialize ⇒ ImageFileOutput
constructor
A new instance of ImageFileOutput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ ImageFileOutput
Returns a new instance of ImageFileOutput.
7 8 9 |
# File 'lib/fluent/plugin/out_imagefile.rb', line 7 def initialize super end |
Instance Method Details
#configure(conf) ⇒ Object
17 18 19 20 |
# File 'lib/fluent/plugin/out_imagefile.rb', line 17 def configure(conf) super end |
#emit(tag, es, chain) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/fluent/plugin/out_imagefile.rb', line 32 def emit(tag, es, chain) es.each {|time,record| file_fullpath = File.join(@save_dir, "#{record[@filename_key]}.#{@extension}") media = record[@image_key] media = Base64.decode64(media) if @base64encoded File.open(file_fullpath, 'wb') {|file| file.write(media)} } chain.next end |
#shutdown ⇒ Object
27 28 29 30 |
# File 'lib/fluent/plugin/out_imagefile.rb', line 27 def shutdown super end |
#start ⇒ Object
22 23 24 25 |
# File 'lib/fluent/plugin/out_imagefile.rb', line 22 def start super end |