Class: Io::Flow::V0::Models::MonthlyAverage

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ MonthlyAverage

Returns a new instance of MonthlyAverage.



46828
46829
46830
46831
46832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46828

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @volume = (x = opts.delete(:volume); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MonthlyAverageVolume) ? x : ::Io::Flow::V0::Models::MonthlyAverageVolume.new(x)))
  @number_transactions = (x = opts.delete(:number_transactions); x.nil? ? nil : HttpClient::Preconditions.assert_class('number_transactions', x, Integer))
end

Instance Attribute Details

#number_transactionsObject (readonly)

Returns the value of attribute number_transactions.



46826
46827
46828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46826

def number_transactions
  @number_transactions
end

#volumeObject (readonly)

Returns the value of attribute volume.



46826
46827
46828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46826

def volume
  @volume
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



46838
46839
46840
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46838

def copy(incoming={})
  MonthlyAverage.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



46842
46843
46844
46845
46846
46847
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46842

def to_hash
  {
    :volume => volume.nil? ? nil : volume.to_hash,
    :number_transactions => number_transactions
  }
end

#to_jsonObject



46834
46835
46836
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46834

def to_json
  JSON.dump(to_hash)
end