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.



50522
50523
50524
50525
50526
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50522

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.



50520
50521
50522
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50520

def number_transactions
  @number_transactions
end

#volumeObject (readonly)

Returns the value of attribute volume.



50520
50521
50522
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50520

def volume
  @volume
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50532
50533
50534
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50532

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

#to_hashObject



50536
50537
50538
50539
50540
50541
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50536

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

#to_jsonObject



50528
50529
50530
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50528

def to_json
  JSON.dump(to_hash)
end