Sha256: 90e989900520770574a74f0f2d8147f3964ba745253a4fb999d2e1644cc16edd
Contents?: true
Size: 617 Bytes
Versions: 1
Compression:
Stored size: 617 Bytes
Contents
module JakubMyNewGem class Build def initialize total:, gratuity: @total = total @gratutity = gratuity end def generate return calculation if number_based? string_based end def number_based? (@gratutity.is_a? Numeric) || (@gratutity.integer?) end def string_based case @gratutity.downcase when 'high' then calculation 25 when 'standard' then calculation 18 when 'low' then calculation 15 end end def calculation gratuity = @gratutity @total += @total * (gratuity.to_f / 100) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jakub_my_new_gem-0.1.0 | lib/jakub_my_new_gem/build.rb |