Method: OCI::Monitoring::Models::Datapoint#initialize

Defined in:
lib/oci/monitoring/models/datapoint.rb

#initialize(attributes = {}) ⇒ Datapoint

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :timestamp (DateTime)

    The value to assign to the #timestamp property

  • :value (Float)

    The value to assign to the #value property

  • :count (Integer)

    The value to assign to the #count property



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/monitoring/models/datapoint.rb', line 62

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.timestamp = attributes[:'timestamp'] if attributes[:'timestamp']

  self.value = attributes[:'value'] if attributes[:'value']

  self.count = attributes[:'count'] if attributes[:'count']
end