Class: Asana::Resources::CustomFieldSetting
- Inherits:
-
CustomFieldSettingsBase
- Object
- Resource
- CustomFieldSettingsBase
- Asana::Resources::CustomFieldSetting
- Defined in:
- lib/asana/resources/custom_field_settings.rb
Overview
Custom fields are applied to a particular project or portfolio with the Custom Field Settings resource. This resource both represents the many-to-many join of the Custom Field and Project or Portfolio as well as stores information that is relevant to that particular pairing; for instance, the ‘is_important` property determines some possible application-specific handling of that custom field and parent.
Instance Attribute Summary collapse
- #created_at ⇒ Object readonly
- #custom_field ⇒ Object readonly
- #gid ⇒ Object readonly
- #is_important ⇒ Object readonly
- #parent ⇒ Object readonly
- #project ⇒ Object readonly
- #resource_type ⇒ Object readonly
Class Method Summary collapse
-
.find_by_portfolio(client, portfolio: required("portfolio"), per_page: 20, options: {}) ⇒ Object
Returns a list of all of the custom fields settings on a portfolio.
-
.find_by_project(client, project: required("project"), per_page: 20, options: {}) ⇒ Object
Returns a list of all of the custom fields settings on a project.
-
.plural_name ⇒ Object
Returns the plural name of the resource.
Methods inherited from CustomFieldSettingsBase
get_custom_field_settings_for_portfolio, get_custom_field_settings_for_project, inherited
Methods inherited from Resource
#initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s
Methods included from ResponseHelper
Constructor Details
This class inherits a constructor from Asana::Resources::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Asana::Resources::Resource
Instance Attribute Details
#created_at ⇒ Object (readonly)
18 19 20 |
# File 'lib/asana/resources/custom_field_settings.rb', line 18 def created_at @created_at end |
#custom_field ⇒ Object (readonly)
26 27 28 |
# File 'lib/asana/resources/custom_field_settings.rb', line 26 def custom_field @custom_field end |
#gid ⇒ Object (readonly)
14 15 16 |
# File 'lib/asana/resources/custom_field_settings.rb', line 14 def gid @gid end |
#is_important ⇒ Object (readonly)
20 21 22 |
# File 'lib/asana/resources/custom_field_settings.rb', line 20 def is_important @is_important end |
#parent ⇒ Object (readonly)
22 23 24 |
# File 'lib/asana/resources/custom_field_settings.rb', line 22 def parent @parent end |
#project ⇒ Object (readonly)
24 25 26 |
# File 'lib/asana/resources/custom_field_settings.rb', line 24 def project @project end |
#resource_type ⇒ Object (readonly)
16 17 18 |
# File 'lib/asana/resources/custom_field_settings.rb', line 16 def resource_type @resource_type end |
Class Method Details
.find_by_portfolio(client, portfolio: required("portfolio"), per_page: 20, options: {}) ⇒ Object
Returns a list of all of the custom fields settings on a portfolio.
49 50 51 52 |
# File 'lib/asana/resources/custom_field_settings.rb', line 49 def find_by_portfolio(client, portfolio: required("portfolio"), per_page: 20, options: {}) params = { limit: per_page }.reject { |_,v| v.nil? || Array(v).empty? } Collection.new(parse(client.get("/portfolios/#{portfolio}/custom_field_settings", params: params, options: )), type: Resource, client: client) end |
.find_by_project(client, project: required("project"), per_page: 20, options: {}) ⇒ Object
Returns a list of all of the custom fields settings on a project.
39 40 41 42 |
# File 'lib/asana/resources/custom_field_settings.rb', line 39 def find_by_project(client, project: required("project"), per_page: 20, options: {}) params = { limit: per_page }.reject { |_,v| v.nil? || Array(v).empty? } Collection.new(parse(client.get("/projects/#{project}/custom_field_settings", params: params, options: )), type: Resource, client: client) end |
.plural_name ⇒ Object
Returns the plural name of the resource.
30 31 32 |
# File 'lib/asana/resources/custom_field_settings.rb', line 30 def plural_name 'custom_field_settings' end |