Class: Helium::DataPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/helium/data_point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:, params:) ⇒ DataPoint

Returns a new instance of DataPoint.



5
6
7
8
9
10
11
# File 'lib/helium/data_point.rb', line 5

def initialize(client:, params:)
  @client     = client
  @id         = params["id"]
  @timestamp  = params["attributes"]["timestamp"]
  @value      = params["attributes"]["value"]
  @port       = params["attributes"]["port"]
end

Instance Attribute Details

#id ⇒ Object

Returns the value of attribute id.



3
4
5
# File 'lib/helium/data_point.rb', line 3

def id
  @id
end

#port ⇒ Object

Returns the value of attribute port.



3
4
5
# File 'lib/helium/data_point.rb', line 3

def port
  @port
end

#timestamp ⇒ Object

Returns the value of attribute timestamp.



3
4
5
# File 'lib/helium/data_point.rb', line 3

def timestamp
  @timestamp
end

#value ⇒ Object

Returns the value of attribute value.



3
4
5
# File 'lib/helium/data_point.rb', line 3

def value
  @value
end