Class: MetricSystem::IO
Instance Method Summary collapse
- #add_event(table, name, value, starts_at) ⇒ Object
-
#initialize(io) ⇒ IO
constructor
A new instance of IO.
- #quit_server! ⇒ Object
Constructor Details
#initialize(io) ⇒ IO
Returns a new instance of IO.
2 3 4 5 |
# File 'lib/metric_system/io.rb', line 2 def initialize(io) expect! io => ::IO @io = io end |
Instance Method Details
#add_event(table, name, value, starts_at) ⇒ Object
7 8 9 10 |
# File 'lib/metric_system/io.rb', line 7 def add_event(table, name, value, starts_at) starts_at = Time.now unless starts_at @io.puts "#{table} #{name} #{value} #{starts_at}" end |
#quit_server! ⇒ Object
12 13 14 |
# File 'lib/metric_system/io.rb', line 12 def quit_server! @io.puts "SHUTDOWN:SERVER" end |