Class: Observed::FakeSystem
- Inherits:
-
Object
- Object
- Observed::FakeSystem
- Defined in:
- lib/observed/observed_task_factory.rb
Overview
An yet another cushion from the deprecated plugin interface to the new plugin interface
Instance Method Summary collapse
-
#initialize(args) ⇒ FakeSystem
constructor
A new instance of FakeSystem.
- #now ⇒ Object
- #report(tag, time, data = nil) ⇒ Object
- #reported ⇒ Object
Constructor Details
#initialize(args) ⇒ FakeSystem
Returns a new instance of FakeSystem.
10 11 12 |
# File 'lib/observed/observed_task_factory.rb', line 10 def initialize(args) @time = args[:time] || Time.now end |
Instance Method Details
#now ⇒ Object
36 37 38 |
# File 'lib/observed/observed_task_factory.rb', line 36 def now @time end |
#report(tag, time, data = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/observed/observed_task_factory.rb', line 14 def report(tag, time, data=nil) = nil if tag.is_a?(::Hash) data = tag = time || {} tag = nil elsif tag.is_a?(String) && time.is_a?(::Hash) = data data = time else = {tag: tag, time: time} end ||= {} [:tag] ||= tag [:time] ||= now @reported = [data, ] end |
#reported ⇒ Object
32 33 34 |
# File 'lib/observed/observed_task_factory.rb', line 32 def reported @reported end |