Class: GRI::Writer
Direct Known Subclasses
FluentWriter, InfluxdbWriter, RRDWriter, STDOUTWriter, TextWriter
Constant Summary collapse
- TYPES =
{}
Instance Attribute Summary collapse
-
#loop ⇒ Object
Returns the value of attribute loop.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Writer
constructor
A new instance of Writer.
Constructor Details
#initialize(options = {}) ⇒ Writer
Returns a new instance of Writer.
22 23 |
# File 'lib/gri/writer.rb', line 22 def initialize ={} end |
Instance Attribute Details
#loop ⇒ Object
Returns the value of attribute loop.
20 21 22 |
# File 'lib/gri/writer.rb', line 20 def loop @loop end |
Class Method Details
.create(wtype, options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/gri/writer.rb', line 7 def self.create wtype, if (klass = TYPES[wtype]) .select {|k, v| String === k}.each {|k, v| [k.gsub('-', '_').intern] = v} begin klass.new rescue Log.error "Writer.create error: #{$!}" nil end end end |