Class: Zendesk::Resource

Inherits:
Object
  • Object
show all
Includes:
Constants, Properties
Defined in:
lib/zendesk/resource.rb

Direct Known Subclasses

Comment, Ticket, User

Constant Summary

Constants included from Constants

Constants::PRIORITY, Constants::RESTRICTION, Constants::ROLE, Constants::STATUS, Constants::TICKET_TYPE, Constants::VIA

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Properties

included

Constructor Details

#initialize(attrs = {}) ⇒ Resource

TODO: Make load file as optional



7
8
9
10
# File 'lib/zendesk/resource.rb', line 7

def initialize(attrs = {})
  load_attributes(attrs)
  load_properties(attrs)
end

Class Method Details

.create(attrs = {}) ⇒ Object



16
17
18
19
20
# File 'lib/zendesk/resource.rb', line 16

def self.create(attrs = {})
  instance = new(attrs)
  instance.save
  instance
end

Instance Method Details

#load_data(xml_stream) ⇒ Object



12
13
14
# File 'lib/zendesk/resource.rb', line 12

def load_data(xml_stream)
  Zendesk.xml_in(xml_stream)
end