Class: Asana::Resources::CustomFieldSetting

Inherits:
Resource
  • Object
show all
Defined in:
lib/asana/resources/custom_field_settings.rb

Overview

Custom fields are attached to a particular project with the Custom Field Settings resource. This resource both represents the many-to-many join of the Custom Field and Project 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 (see below)

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Resource

inherited, #initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s

Methods included from ResponseHelper

#parse

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_atObject (readonly)



16
17
18
# File 'lib/asana/resources/custom_field_settings.rb', line 16

def created_at
  @created_at
end

#custom_fieldObject (readonly)



22
23
24
# File 'lib/asana/resources/custom_field_settings.rb', line 22

def custom_field
  @custom_field
end

#idObject (readonly)



14
15
16
# File 'lib/asana/resources/custom_field_settings.rb', line 14

def id
  @id
end

#is_importantObject (readonly)



18
19
20
# File 'lib/asana/resources/custom_field_settings.rb', line 18

def is_important
  @is_important
end

#projectObject (readonly)



20
21
22
# File 'lib/asana/resources/custom_field_settings.rb', line 20

def project
  @project
end

Class Method Details

.find_by_project(client, project: required("project"), options: {}) ⇒ Object

Returns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, ‘opt_fields` and `opt_expand` can be used to include more data than is returned in the compact representation. See the getting started guide on [input/output options](/developers/documentation/getting-started/input-output-options) for more information.

Parameters:

  • project (Id) (defaults to: required("project"))

    The ID of the project for which to list custom field settings

  • options (Hash) (defaults to: {})

    the request I/O options.



34
35
36
37
# File 'lib/asana/resources/custom_field_settings.rb', line 34

def find_by_project(client, project: required("project"), options: {})

  Resource.new(parse(client.get("/projects/#{project}/custom_field_settings", options: options)).first, client: client)
end

.plural_nameObject

Returns the plural name of the resource.



26
27
28
# File 'lib/asana/resources/custom_field_settings.rb', line 26

def plural_name
  'custom_field_settings'
end