Class: DataCollector::Output::Generic
- Inherits:
-
Object
- Object
- DataCollector::Output::Generic
- Defined in:
- lib/data_collector/output/generic.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(uri, options = {}) ⇒ Generic
constructor
A new instance of Generic.
- #running? ⇒ Boolean
- #send(message) ⇒ Object
- #stop ⇒ Object
- #stopped? ⇒ Boolean
Constructor Details
#initialize(uri, options = {}) ⇒ Generic
Returns a new instance of Generic.
9 10 11 12 13 14 15 16 |
# File 'lib/data_collector/output/generic.rb', line 9 def initialize(uri, = {}) @uri = uri @options = @running = false @name = [:name] || "output-#{Time.now.to_i}-#{rand(10000)}" create_producer end |
Instance Method Details
#running? ⇒ Boolean
22 23 24 |
# File 'lib/data_collector/output/generic.rb', line 22 def running? @running end |
#send(message) ⇒ Object
18 19 20 |
# File 'lib/data_collector/output/generic.rb', line 18 def send() raise DataCollector::Error, 'Please implement a producer' end |
#stop ⇒ Object
30 31 32 |
# File 'lib/data_collector/output/generic.rb', line 30 def stop @running = false end |
#stopped? ⇒ Boolean
26 27 28 |
# File 'lib/data_collector/output/generic.rb', line 26 def stopped? @running == false end |