Class: ZendeskAPI::Topic

Inherits:
Resource show all
Defined in:
lib/zendesk_api/resources/forum.rb

Defined Under Namespace

Classes: TopicComment, TopicVote

Instance Attribute Summary

Attributes inherited from Data

#association, #attributes

Instance Method Summary collapse

Methods included from Read

#find

Methods included from Destroy

#destroy, #destroyed?

Methods included from Save

#save, #save!, #save_associations

Methods included from Verbs

#delete, #post, #put

Methods inherited from Data

#==, #id, #initialize, #method_missing, #new_record?, only_send_unnested_params, #path, resource_name, singular_resource_name, #to_s, unnested_params

Methods included from Associations

#wrap_resource

Constructor Details

This class inherits a constructor from ZendeskAPI::Data

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ZendeskAPI::Data

Instance Method Details

#votes(opts = {}) ⇒ Object



44
45
46
47
48
49
# File 'lib/zendesk_api/resources/forum.rb', line 44

def votes(opts = {})
  return @votes if @votes && !opts[:reload]

  association = ZendeskAPI::Association.new(:class => Topic::TopicVote, :parent => self, :path => 'votes')
  @votes = ZendeskAPI::Collection.new(@client, Topic::TopicVote, opts.merge(:association => association))
end