Class: MetricSystem::Server::Event

Inherits:
Struct
  • Object
show all
Defined in:
lib/metric_system/server.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



29
30
31
# File 'lib/metric_system/server.rb', line 29

def name
  @name
end

#tableObject

Returns the value of attribute table

Returns:

  • (Object)

    the current value of table



29
30
31
# File 'lib/metric_system/server.rb', line 29

def table
  @table
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



29
30
31
# File 'lib/metric_system/server.rb', line 29

def time
  @time
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



29
30
31
# File 'lib/metric_system/server.rb', line 29

def value
  @value
end

Class Method Details

.parse(line) ⇒ Object



30
31
32
33
34
35
# File 'lib/metric_system/server.rb', line 30

def self.parse(line)
  table, name, value, time, remainder = line.split(" ", 5)
  value = value.to_f
  time = time != "" ? time.to_i : nil
  new(table, name, value, time)
end