Class: Zendesk2::UserField
- Inherits:
-
Object
- Object
- Zendesk2::UserField
- Extended by:
- Attributes
- Includes:
- Model
- Defined in:
- lib/zendesk2/user_field.rb
Instance Attribute Summary
Attributes included from Model
Instance Method Summary collapse
-
#active ⇒ Boolean
If true, this field is available for use.
-
#created_at ⇒ Time
The time the ticket field was created.
-
#custom_field_options ⇒ Array
Required and presented for a custom field of type “tagger”.
-
#description ⇒ String
User-defined description of this field’s purpose.
- #destroy! ⇒ Object
-
#id ⇒ Integer
Automatically assigned upon creation.
-
#key ⇒ String
This is used for updating the field and referencing in placeholders.
-
#position ⇒ Integer
Ordering of the field relative to other fields.
-
#regexp_for_validation ⇒ String
Regular expression field only.
- #save! ⇒ Object
-
#tag ⇒ String
Optional for custom field of type “checkbox”; not presented otherwise.
-
#title ⇒ String
The title of the custom field.
-
#type ⇒ String
(custom dropdown).
-
#updated_at ⇒ Time
The time of the last update of the ticket field.
-
#url ⇒ String
The URL for this resource.
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 true, this field is available for use.
11 |
# File 'lib/zendesk2/user_field.rb', line 11 attribute :active, type: :boolean |
#created_at ⇒ Time
Returns The time the ticket field was created.
13 |
# File 'lib/zendesk2/user_field.rb', line 13 attribute :created_at, type: :time |
#custom_field_options ⇒ Array
Returns Required and presented for a custom field of type “tagger”.
15 |
# File 'lib/zendesk2/user_field.rb', line 15 attribute :custom_field_options, type: :array |
#description ⇒ String
Returns User-defined description of this field’s purpose.
17 |
# File 'lib/zendesk2/user_field.rb', line 17 attribute :description, type: :string |
#destroy! ⇒ Object
51 52 53 54 55 |
# File 'lib/zendesk2/user_field.rb', line 51 def destroy! requires :identity cistern.destroy_user_field('user_field' => { 'id' => identity }) end |
#id ⇒ Integer
Returns Automatically assigned upon creation.
8 |
# File 'lib/zendesk2/user_field.rb', line 8 identity :id, type: :integer |
#key ⇒ String
This is used for updating the field and referencing in placeholders.
20 |
# File 'lib/zendesk2/user_field.rb', line 20 attribute :key, type: :string |
#position ⇒ Integer
Returns Ordering of the field relative to other fields.
22 |
# File 'lib/zendesk2/user_field.rb', line 22 attribute :position, type: :integer |
#regexp_for_validation ⇒ String
Returns Regular expression field only. The validation pattern for a field value to be deemed valid.
24 |
# File 'lib/zendesk2/user_field.rb', line 24 attribute :regexp_for_validation, type: :string |
#save! ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/zendesk2/user_field.rb', line 37 def save! response = if new_record? requires :type, :title, :key cistern.create_user_field('user_field' => attributes) else requires :identity cistern.update_user_field('user_field' => attributes) end merge_attributes(response.body['user_field']) end |
#tag ⇒ String
Returns Optional for custom field of type “checkbox”; not presented otherwise.
26 |
# File 'lib/zendesk2/user_field.rb', line 26 attribute :tag, type: :string |
#title ⇒ String
Returns The title of the custom field.
28 |
# File 'lib/zendesk2/user_field.rb', line 28 attribute :title, type: :string |
#type ⇒ String
(custom dropdown)
31 |
# File 'lib/zendesk2/user_field.rb', line 31 attribute :type, type: :string |
#updated_at ⇒ Time
Returns The time of the last update of the ticket field.
33 |
# File 'lib/zendesk2/user_field.rb', line 33 attribute :updated_at, type: :time |
#url ⇒ String
Returns The URL for this resource.
35 |
# File 'lib/zendesk2/user_field.rb', line 35 attribute :url, type: :string |