diff --git a/contact.rb b/contact.rb new file mode 100644 index 0000000..95020d6 --- /dev/null +++ b/contact.rb @@ -0,0 +1,41 @@ +#!/usr/bin/env ruby + +class Contact + # Contact is mainly an associated array + # with some standard keys such as: + # - name, phone, port, email, address... + # The idea behind this class is to be able + # to show the contact informations along + # with the + DefaultValues=[ "name", "email", "phone", "website", + "address", "url" ] + def initialize (name) + @information["name"]=name; + @information["email"]=[]; + @information["phone"]=[]; + @information["website"]=[]; + @information["url"]=[]; + @information["address"]=[]; + end + + def append_info(key, value) + @information[key].append(value) + end + + def add_email (email) + append_info("email",email); + end + + def add_phone (phone) + append_info("phone",phone); + end + + def add_website(website) + append_info("website",website); + end + + def add_url(url) + append_info("url",url); + end + +end diff --git a/taskTime.rb b/taskTime.rb new file mode 100644 index 0000000..d1e4325 --- /dev/null +++ b/taskTime.rb @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby + +class TaskTime + @creation_date # creation date of the task + @done_date # date at which the task was done + @start_date # date at with the task began (hour,minute,second) + @due_date # due date for the task + @duration # time spend for finish that task + # can be set by the user to be + # different than (@done_date - @start_date) + @max_duration # maximal duration for that task + @min_duration # minimal duration for that task + def initialize() + @creation_date=Time.now + end +end diff --git a/todo.rb b/todo.rb index f333898..acb9156 100644 --- a/todo.rb +++ b/todo.rb @@ -1,60 +1,5 @@ #!/usr/bin/env ruby -class Contact - # Contact is mainly an associated array - # with some standard keys such as: - # - name, phone, port, email, address... - # The idea behind this class is to be able - # to show the contact informations along - # with the - DefaultValues=[ "name", "email", "phone", "website", - "address", "url" ] - def initialize (name) - @information["name"]=name; - @information["email"]=[]; - @information["phone"]=[]; - @information["website"]=[]; - @information["url"]=[]; - @information["address"]=[]; - end - - def append_info(key, value) - @information[key].append(value) - end - - def add_email (email) - append_info("email",email); - end - - def add_phone (phone) - append_info("phone",phone); - end - - def add_website(website) - append_info("website",website); - end - - def add_url(url) - append_info("url",url); - end - -end - -class TaskTime - @creation_date # creation date of the task - @done_date # date at which the task was done - @start_date # date at with the task began (hour,minute,second) - @due_date # due date for the task - @duration # time spend for finish that task - # can be set by the user to be - # different than (@done_date - @start_date) - @max_duration # maximal duration for that task - @min_duration # minimal duration for that task - def initialize() - @creation_date=Time.now - end -end - class Task def initialize(description, note, contacts, contexts, projects, dates)