lib/tribe_challenge/tribe_bundles.rb
def price(code, count)
      response = bundles(code)
      return false if response == false

      bundle = response.find{|h| h[:count] == count}
      bundle[:price]
    end
##
# Get price for a specific code, and bundle count.
#
# @param [Symbol] code, the code for the bundles we are interested in.
# @param [Symbol] count, the count for the bundles we are interested in.
#
# @return [Integer], price found for specific code-count.
##
Get price for a specific code, and bundle count.
Get price for a specific code and bundle count .
def price(code, count)
      response = bundles(code)
      return false if response == false
      bundle = response.find{|h| h[:count] == count}
      bundle[:price]
    end
def price ( code , count ) response = bundles ( code ) return false if response == false bundle = response . find { | h | h [ :count ] == count } bundle [ :price ] end
Get price for a specific code, and bundle count.
Get price for a specific code and bundle count .
, price found for specific code-count.
price found for specific code - count .
Integer
code
count
count, the count for the bundles we are interested in.
count the count for the bundles we are interested in .