Method: WebApiActivequerybuilder::Totals#initialize

Defined in:
lib/webapi-active-query-builder/models/totals.rb

#initialize(attributes = {}) ⇒ Totals

Initializes the object

Parameters:

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

    Model attributes in the form of hash



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/webapi-active-query-builder/models/totals.rb', line 75

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?(:'field')
    self.field = attributes[:'field']
  end

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

end