Assignment 1/StockObject.rb
###### METHODS ######
###### 1. INSTANCE METHOD: planting 7 gr. of seeds for each stock record ######
# this function takes 1 argument: the number of grams of seeds wanted to plant
METHODS
1. INSTANCE METHOD: planting 7 gr. of seeds for each stock record
this function takes 1 argument: the number of grams of seeds wanted to plant
METHODS 1 . INSTANCE METHOD : planting 7 gr . of seeds for each stock record this function takes 1 argument : the number of grams of seeds wanted to plant
def planting_seeds(grams_to_plant)
    if @gramsremaining > grams_to_plant
      @gramsremaining = @gramsremaining - grams_to_plant
    else
      @gramsremaining = 0
      puts "WARNING: we have run out of Seed Stock #{@seedstock}"
    end
    return @gramsremaining
  end
def planting_seeds ( grams_to_plant ) if @gramsremaining > grams_to_plant @gramsremaining = @gramsremaining - grams_to_plant else @gramsremaining = 0 puts "WARNING: we have run out of Seed Stock #{@seedstock}" end return @gramsremaining end
METHODS
1.
METHODS 1 .
# if having more grams remaining than wanted to plant, then plant # if having less or equal grams remaining than wanted to plant, cannot plant # warning message with interpolated attribute #code
grams_to_plant
<not_specific>