lib/tianming_shopicruit/shopicruit.rb
# array of variants => array of floats
# Given an array of variants, returns an array of their respective prices
array of variants => array of floats
Given an array of variants, returns an array of their respective prices
array of variants = > array of floats Given an array of variants returns an array of their respective prices
def calc_variants_prices_sum(variants)
    variants_prices = variants.map do |variant|
      variant['price'].to_f
    end
    variants_prices.reduce(&:+)
  end
def calc_variants_prices_sum ( variants ) variants_prices = variants . map do | variant | variant [ 'price' ] . to_f end variants_prices . reduce ( & :+ ) end
array of variants => array of floats
Given an array of variants, returns an array of their respective prices
array of variants = > array of floats Given an array of variants returns an array of their respective prices
variants
<not_specific>