Module: StockCheck

Defined in:
lib/stockChecker.rb

Class Method Summary collapse

Class Method Details

.quantCheck(isQuantityLow) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/stockChecker.rb', line 2

def self.quantCheck(isQuantityLow)  
    if isQuantityLow <= 10 && isQuantityLow > 5
      ans = "Low Stock"
    elsif
      isQuantityLow <= 5 && isQuantityLow >= 1
      ans = "Very Low Stock"
    elsif
      isQuantityLow == 0
      ans = "Out of Stock!"
    elsif
      isQuantityLow < 0
      ans = "Negative Stock Entered!"
    else  
      ans = "OK"    
    end 
    return  ans 
end