Class: ZendeskAPI::Topic
- Inherits:
-
Resource
- Object
- Data
- DataResource
- Resource
- ZendeskAPI::Topic
- Defined in:
- lib/zendesk_api/resources.rb,
lib/zendesk_api/resources.rb
Defined Under Namespace
Classes: TopicComment, TopicVote
Instance Attribute Summary
Attributes inherited from DataResource
Attributes inherited from Data
#association, #attributes, #errors, #response
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Destroy
#destroy, #destroy!, #destroyed?, included
Methods included from Update
Methods included from Save
#clear_associations, #save, #save!, #save_associations
Methods included from ResponseHandler
Methods included from Create
Methods included from Read
Methods included from Sideloading
Methods included from Verbs
Methods inherited from Data
#==, #id, inherited, #initialize, #loaded_associations, #method_missing, namespace, new_from_response, #new_record?, #path, resource_name, resource_path, singular_resource_name, subclasses, #to_json, #to_s
Methods included from Associations
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
Class Method Details
.import(client, attributes) ⇒ Object
237 238 239 240 241 |
# File 'lib/zendesk_api/resources.rb', line 237 def self.import(client, attributes) topic = new(client, attributes) return unless topic.save(:path => "import/topics") topic end |
.import!(client, attributes) ⇒ Object
231 232 233 234 235 |
# File 'lib/zendesk_api/resources.rb', line 231 def self.import!(client, attributes) new(client, attributes).tap do |topic| topic.save!(:path => "import/topics") end end |
Instance Method Details
#votes(opts = {}) ⇒ Object
224 225 226 227 228 229 |
# File 'lib/zendesk_api/resources.rb', line 224 def votes(opts = {}) return @votes if @votes && !opts[:reload] association = ZendeskAPI::Association.new(:class => TopicVote, :parent => self, :path => 'votes') @votes = ZendeskAPI::Collection.new(@client, TopicVote, opts.merge(:association => association)) end |