Method: IntegrationApi::Stat#initialize

Defined in:
lib/integration_api/models/stat.rb

#initialize(attributes = {}) ⇒ Stat

Initializes the object

Parameters:

  • (defaults to: {})

    Model attributes in the form of hash



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/integration_api/models/stat.rb', line 42

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 }

  if attributes.has_key?(:'stat_name')
    self.stat_name = attributes[:'stat_name']
  end

  if attributes.has_key?(:'stat_value')
    self.stat_value = attributes[:'stat_value']
  end
end