Class: Sfn::Topic

Inherits:
Resource show all
Defined in:
lib/satisfaction/topic.rb

Instance Attribute Summary

Attributes inherited from Resource

#id

Attributes inherited from HasSatisfaction

#satisfaction

Instance Method Summary collapse

Methods inherited from Resource

decode_sfn, #delete, #initialize, #inspect, #load, #loaded?, #put, #was_loaded

Methods included from Util

#requestify

Methods included from Resource::Attributes

included

Methods included from Associations

#belongs_to, #has_many

Methods inherited from HasSatisfaction

#initialize

Constructor Details

This class inherits a constructor from Sfn::Resource

Instance Method Details

#pathObject



7
8
9
# File 'lib/satisfaction/topic.rb', line 7

def path
  "/topics/#{@id}"
end

#setup_associationsObject



11
12
13
14
15
16
17
18
# File 'lib/satisfaction/topic.rb', line 11

def setup_associations
  has_many :replies, :url => "#{path}/replies"
  has_many :people, :url => "#{path}/people"
  has_many :products, :url => "#{path}/products"
  has_many :tags, :url => "#{path}/tags"
  
  belongs_to :company
end