Class: Zendesk2::Group
- Inherits:
-
Object
- Object
- Zendesk2::Group
- Extended by:
- Attributes
- Includes:
- Model
- Defined in:
- lib/zendesk2/group.rb
Instance Attribute Summary
Attributes included from Model
Instance Method Summary collapse
-
#created_at ⇒ Time
The time the group was created.
-
#deleted ⇒ Boolean
Deleted groups get marked as such.
- #destroy! ⇒ Object
- #destroyed? ⇒ Boolean
-
#id ⇒ Integer
Automatically assigned when creating groups.
-
#name ⇒ String
The name of the group.
- #save! ⇒ Object
-
#updated_at ⇒ Time
The time of the last update of the group.
-
#url ⇒ String
The API url of this group.
Methods included from Attributes
assoc_accessor, assoc_reader, assoc_writer
Methods included from Model
#destroy, #missing_attributes, #save, #update!
Instance Method Details
#created_at ⇒ Time
Returns The time the group was created.
11 |
# File 'lib/zendesk2/group.rb', line 11 attribute :created_at, type: :time |
#deleted ⇒ Boolean
Returns Deleted groups get marked as such.
13 |
# File 'lib/zendesk2/group.rb', line 13 attribute :deleted, type: :boolean |
#destroy! ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/zendesk2/group.rb', line 35 def destroy! requires :identity cistern.destroy_group('group' => { 'id' => identity }) self.deleted = true end |
#destroyed? ⇒ Boolean
43 44 45 |
# File 'lib/zendesk2/group.rb', line 43 def destroyed? deleted end |
#id ⇒ Integer
Returns Automatically assigned when creating groups.
8 |
# File 'lib/zendesk2/group.rb', line 8 identity :id, type: :integer |
#name ⇒ String
Returns The name of the group.
15 |
# File 'lib/zendesk2/group.rb', line 15 attribute :name, type: :string |
#save! ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/zendesk2/group.rb', line 21 def save! data = if new_record? requires :name cistern.create_group('group' => attributes) else requires :identity cistern.update_group('group' => attributes) end.body['group'] merge_attributes(data) end |
#updated_at ⇒ Time
Returns The time of the last update of the group.
17 |
# File 'lib/zendesk2/group.rb', line 17 attribute :updated_at, type: :time |
#url ⇒ String
Returns The API url of this group.
19 |
# File 'lib/zendesk2/group.rb', line 19 attribute :url, type: :string |