Class: AutotaskAPI::AccountToDo

Inherits:
Entity
  • Object
show all
Defined in:
lib/autotask_api/account_todo.rb

Instance Attribute Summary

Attributes inherited from Entity

#attributes, #raw_xml

Instance Method Summary collapse

Methods inherited from Entity

belongs_to, find, has_one, #initialize, #method_missing

Constructor Details

This class inherits a constructor from AutotaskAPI::Entity

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AutotaskAPI::Entity

Instance Method Details

#completed?Boolean


43
44
45
# File 'lib/autotask_api/account_todo.rb', line 43

def completed?
  !completed_date.blank?
end

#create_timeObject


31
32
33
# File 'lib/autotask_api/account_todo.rb', line 31

def create_time
  Time.parse create_date_time
end

#descriptionObject


27
28
29
# File 'lib/autotask_api/account_todo.rb', line 27

def description
  @title || set_title_and_description.last
end

#end_timeObject


39
40
41
# File 'lib/autotask_api/account_todo.rb', line 39

def end_time
  Time.parse end_date_time
end

#set_title_and_descriptionObject


18
19
20
21
# File 'lib/autotask_api/account_todo.rb', line 18

def set_title_and_description
  @title, @description = activity_description.to_s.split(/\r?\n/).
    collect(&:strip)
end

#start_timeObject


35
36
37
# File 'lib/autotask_api/account_todo.rb', line 35

def start_time
  Time.parse start_date_time
end

#titleObject


23
24
25
# File 'lib/autotask_api/account_todo.rb', line 23

def title
  @title || set_title_and_description.first
end