Class: Zendesk2::TicketForm
- Inherits:
-
Object
- Object
- Zendesk2::TicketForm
- Extended by:
- Attributes
- Includes:
- Model
- Defined in:
- lib/zendesk2/ticket_form.rb
Instance Attribute Summary
Attributes included from Model
Instance Method Summary collapse
-
#active ⇒ Boolean
If the form is set as active.
-
#default ⇒ Boolean
Is the form the default form for this account.
- #destroy! ⇒ Object
-
#display_name ⇒ String
The name of the form that is displayed to an end user.
-
#end_user_visible ⇒ Boolean
Is the form visible to the end user.
-
#id ⇒ integer
Automatically assigned upon creation.
-
#in_all_brands ⇒ Boolean
Is the form available for use in all brands on this account.
-
#name ⇒ String
The name of the form.
-
#position ⇒ Integer
The position of this form among other forms in the account, i.e.
-
#raw_display_name ⇒ String
The dynamic content placeholder, if present, or the “display_name” value, if not.
-
#raw_name ⇒ String
The dynamic content placeholder, if present, or the “name” value, if not.
-
#restricted_brand_ids ⇒ Array
Ids of all brands that this ticket form is restricted to.
- #save! ⇒ Object
-
#ticket_field_ids ⇒ Array
Ids of all ticket fields which are in this ticket form.
Methods included from Attributes
assoc_accessor, assoc_reader, assoc_writer
Methods included from Model
#destroy, #destroyed?, #missing_attributes, #save, #update!
Instance Method Details
#active ⇒ Boolean
Returns If the form is set as active.
21 |
# File 'lib/zendesk2/ticket_form.rb', line 21 attribute :active, type: :boolean |
#default ⇒ Boolean
Returns Is the form the default form for this account.
25 |
# File 'lib/zendesk2/ticket_form.rb', line 25 attribute :default, type: :boolean |
#destroy! ⇒ Object
47 48 49 50 51 |
# File 'lib/zendesk2/ticket_form.rb', line 47 def destroy! requires :identity cistern.destroy_ticket_form('ticket_form' => { 'id' => identity }) end |
#display_name ⇒ String
Returns The name of the form that is displayed to an end user.
15 |
# File 'lib/zendesk2/ticket_form.rb', line 15 attribute :display_name, type: :string |
#end_user_visible ⇒ Boolean
Returns Is the form visible to the end user.
23 |
# File 'lib/zendesk2/ticket_form.rb', line 23 attribute :end_user_visible, type: :boolean |
#id ⇒ integer
Returns Automatically assigned upon creation.
8 |
# File 'lib/zendesk2/ticket_form.rb', line 8 identity :id, type: :integer |
#in_all_brands ⇒ Boolean
Returns Is the form available for use in all brands on this account.
29 |
# File 'lib/zendesk2/ticket_form.rb', line 29 attribute :in_all_brands, type: :boolean |
#name ⇒ String
Returns The name of the form.
11 |
# File 'lib/zendesk2/ticket_form.rb', line 11 attribute :name, type: :string |
#position ⇒ Integer
Returns The position of this form among other forms in the account, i.e. dropdown.
19 |
# File 'lib/zendesk2/ticket_form.rb', line 19 attribute :position, type: :integer |
#raw_display_name ⇒ String
Returns The dynamic content placeholder, if present, or the “display_name” value, if not.
17 |
# File 'lib/zendesk2/ticket_form.rb', line 17 attribute :raw_display_name, type: :string |
#raw_name ⇒ String
Returns The dynamic content placeholder, if present, or the “name” value, if not.
13 |
# File 'lib/zendesk2/ticket_form.rb', line 13 attribute :raw_name, type: :string |
#restricted_brand_ids ⇒ Array
Returns ids of all brands that this ticket form is restricted to.
31 |
# File 'lib/zendesk2/ticket_form.rb', line 31 attribute :restricted_brand_ids, type: :array |
#save! ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/zendesk2/ticket_form.rb', line 33 def save! data = if new_record? requires :name cistern.create_ticket_form('ticket_form' => attributes) else requires :identity cistern.update_ticket_form('ticket_form' => attributes) end.body['ticket_form'] merge_attributes(data) end |
#ticket_field_ids ⇒ Array
Returns ids of all ticket fields which are in this ticket form.
27 |
# File 'lib/zendesk2/ticket_form.rb', line 27 attribute :ticket_field_ids, type: :array |