Class: Zendesk2::Category
- Inherits:
-
Object
- Object
- Zendesk2::Category
- Includes:
- Model
- Defined in:
- lib/zendesk2/category.rb
Instance Attribute Summary
Attributes included from Model
Instance Method Summary collapse
-
#created_at ⇒ Time
The time the category was created.
-
#description ⇒ String
The description of the category.
- #destroy! ⇒ Object
-
#id ⇒ Integer
Automatically assigned during creation.
-
#name ⇒ String
The name of the category.
-
#position ⇒ Integer
The position of this category relative to other categories.
- #save! ⇒ Object
-
#updated_at ⇒ Time
The time of the last update of the category.
-
#url ⇒ String
The API url of this category.
Methods included from Model
#destroy, #destroyed?, #missing_attributes, #save, #update!
Instance Method Details
#created_at ⇒ Time
Returns The time the category was created.
9 |
# File 'lib/zendesk2/category.rb', line 9 attribute :created_at, type: :time |
#description ⇒ String
Returns The description of the category.
11 |
# File 'lib/zendesk2/category.rb', line 11 attribute :description, type: :string |
#destroy! ⇒ Object
21 22 23 24 25 |
# File 'lib/zendesk2/category.rb', line 21 def destroy! requires :identity cistern.destroy_category('category' => { 'id' => identity }) end |
#id ⇒ Integer
Returns Automatically assigned during creation.
6 |
# File 'lib/zendesk2/category.rb', line 6 identity :id, type: :integer |
#name ⇒ String
Returns The name of the category.
13 |
# File 'lib/zendesk2/category.rb', line 13 attribute :name, type: :string |
#position ⇒ Integer
Returns The position of this category relative to other categories.
15 |
# File 'lib/zendesk2/category.rb', line 15 attribute :position, type: :integer |
#save! ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/zendesk2/category.rb', line 27 def save! data = if new_record? requires :name cistern.create_category(params).body['category'] else requires :identity cistern.update_category(params).body['category'] end merge_attributes(data) end |
#updated_at ⇒ Time
Returns The time of the last update of the category.
17 |
# File 'lib/zendesk2/category.rb', line 17 attribute :updated_at, type: :time |
#url ⇒ String
Returns The API url of this category.
19 |
# File 'lib/zendesk2/category.rb', line 19 attribute :url, type: :string |