Class: Teambox::Activity

Inherits:
Resource show all
Defined in:
lib/teambox-client/models/activity.rb

Instance Attribute Summary

Attributes inherited from Resource

#data, #list, #references

Instance Method Summary collapse

Methods inherited from Resource

#created_at, #destroy, #id, #initialize, #inspect, #method_missing, #next, #prev, #reload, #save, #updated_at

Methods included from ReferenceList

#generate_references, #get_or_make_reference, #get_or_make_references, #get_reference, #set_reference

Constructor Details

This class inherits a constructor from Teambox::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Teambox::Resource

Instance Method Details

#comment_targetObject

The target of the comment if this is a Teambox::Comment



19
20
21
# File 'lib/teambox-client/models/activity.rb', line 19

def comment_target
  get_or_make_reference(@data['comment_target_type'], @data, 'comment_target_id')
end

#projectObject

The Teambox::Project this activity belongs to



14
15
16
# File 'lib/teambox-client/models/activity.rb', line 14

def project
  get_or_make_reference('Project', @data, 'project_id')
end

#targetObject

The Teambox::Resource which generated this activity



9
10
11
# File 'lib/teambox-client/models/activity.rb', line 9

def target
  get_or_make_reference(@data['target_type'], @data, 'target_id')
end

#urlObject

:nodoc:



23
24
25
# File 'lib/teambox-client/models/activity.rb', line 23

def url #:nodoc:
  "/activities/#{@data['id']}"
end

#userObject

Teambox::User who generated this activity



4
5
6
# File 'lib/teambox-client/models/activity.rb', line 4

def user
  get_or_make_reference('User', @data, 'user_id')
end