Class: Fluent::YoOutput
- Inherits:
-
Output
- Object
- Output
- Fluent::YoOutput
- Defined in:
- lib/fluent/plugin/out_yo.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #emit(tag, es, chain) ⇒ Object
-
#initialize ⇒ YoOutput
constructor
A new instance of YoOutput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ YoOutput
Returns a new instance of YoOutput.
8 9 10 11 |
# File 'lib/fluent/plugin/out_yo.rb', line 8 def initialize super require 'yo' end |
Instance Method Details
#configure(conf) ⇒ Object
13 14 15 16 17 |
# File 'lib/fluent/plugin/out_yo.rb', line 13 def configure(conf) super raise Fluent::ConfigError, 'Visit http://yoapi.justyo.co/ and get an api key' if !@api_key or @api_key.empty? @yo = Yo.new(@api_key) end |
#emit(tag, es, chain) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/fluent/plugin/out_yo.rb', line 22 def emit(tag, es, chain) begin @yo.yo rescue => e raise Fluent::ConfigError, "Maybe Yo config is mistaken: #{e.class}, #{e.}" end chain.next end |
#shutdown ⇒ Object
20 |
# File 'lib/fluent/plugin/out_yo.rb', line 20 def shutdown; end |
#start ⇒ Object
19 |
# File 'lib/fluent/plugin/out_yo.rb', line 19 def start; end |