class Task # @description: string # @duration: integer minutes attr_accessor :description, :duration @@task_count = 0 # initalize: string X string def initialize(description, duration) @description = description @duration = duration @@task_count = @@task_count + 1 end # scale: double -> void def scale(amount) @duration *= amount end # to_s: void -> void def to_s "#{@description} for #{duration} minutes" end # -> int def self.tasks_created @@task_count end end
if color == :red
numbers.clear() if numbers.size > 50