Class: Pipedrive::Activity

Inherits:
Base
  • Object
show all
Defined in:
lib/pipedrive/activity.rb

Instance Attribute Summary

Attributes inherited from Base

#data

Instance Method Summary collapse

Methods inherited from Base

all, authenticate, bad_response, create, destroy, #destroy, find, find_by_name, #initialize, #initialize_related_objects, new_list, resource_path, search, #update

Constructor Details

This class inherits a constructor from Pipedrive::Base

Instance Method Details

#dateDateTime

Gets the date of the activity

Returns:

  • (DateTime)

9
10
11
# File 'lib/pipedrive/activity.rb', line 9

def date
  DateTime.parse(due_date + ' ' + due_time)
end

#organization(force_reload = false) ⇒ Organization

Gets the organization associated to the activity

Returns:


17
18
19
20
21
22
23
24
# File 'lib/pipedrive/activity.rb', line 17

def organization force_reload=false
  # Get Organization if id is set and if not already set
  if not org_id.nil? and (self[:organization].nil? or force_reload)
    self[:organization] = Organization.find(org_id)
  end
  
  self[:organization]
end