lib/simple_tasks_ruby/models/day.rb
##
# Adds task to a day.
# 
# == Parameters:
# [task] object of a Task class or any of the derived classes
#
# @param task [Task] object of a Task class or any of the derived classes.
Adds task to a day.
Parameters:
[task] object of a Task class or any of the derived classes
Adds task to a day . Parameters : [ task ] object of a Task class or any of the derived classes
def add_task(task)
      raise ArgumentError, "Only tasks can be added to days. You tried to add object of type: #{task.class}" unless task.is_a?(Task)
      @tasks.push(task)
    end
def add_task ( task ) raise ArgumentError , "Only tasks can be added to days. You tried to add object of type: #{task.class}" unless task . is_a? ( Task ) @tasks . push ( task ) end
Adds task to a day.
Adds task to a day .
# TODO: Not a perfect solution (checking type of class) but a different handling would require Task and its hierarchy to be changed
task
object of a Task class or any of the derived classes.
object of a Task class or any of the derived classes .