lib/population.rb
# Terminate units which age is over the 'limit_age'.

Terminate units which age is over the 'limit_age'.
Terminate units which age is over the ' limit_age ' .
def terminate_by_age(limit_age=5)
    tmp_units = []
    @units.each do |un|
      if un.age < limit_age
        tmp_units << un
      end
    end
    @units = tmp_units
    return nil
  end
def terminate_by_age ( limit_age = 5 ) tmp_units = [ ] @units . each do | un | if un . age < limit_age tmp_units << un end end @units = tmp_units return nil end
Terminate units which age is over the 'limit_age'.
Terminate units which age is over the ' limit_age ' .
limit_age
<not_specific>