Class: Asana::Resources::CustomFieldSetting
- Inherits:
-
Resource
- Object
- Resource
- Asana::Resources::CustomFieldSetting
show all
- 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
Class Method Summary
collapse
Methods inherited from Resource
inherited, #initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s
#parse
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
21
22
23
|
# File 'lib/asana/resources/custom_field_settings.rb', line 21
def created_at
@created_at
end
|
#custom_field ⇒ Object
29
30
31
|
# File 'lib/asana/resources/custom_field_settings.rb', line 29
def custom_field
@custom_field
end
|
#gid ⇒ Object
17
18
19
|
# File 'lib/asana/resources/custom_field_settings.rb', line 17
def gid
@gid
end
|
#id ⇒ Object
15
16
17
|
# File 'lib/asana/resources/custom_field_settings.rb', line 15
def id
@id
end
|
#is_important ⇒ Object
23
24
25
|
# File 'lib/asana/resources/custom_field_settings.rb', line 23
def is_important
@is_important
end
|
#parent ⇒ Object
25
26
27
|
# File 'lib/asana/resources/custom_field_settings.rb', line 25
def parent
@parent
end
|
#project ⇒ Object
27
28
29
|
# File 'lib/asana/resources/custom_field_settings.rb', line 27
def project
@project
end
|
#resource_type ⇒ Object
19
20
21
|
# File 'lib/asana/resources/custom_field_settings.rb', line 19
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.
52
53
54
55
|
# File 'lib/asana/resources/custom_field_settings.rb', line 52
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: 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.
42
43
44
45
|
# File 'lib/asana/resources/custom_field_settings.rb', line 42
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: options)), type: Resource, client: client)
end
|
.plural_name ⇒ Object
Returns the plural name of the resource.
33
34
35
|
# File 'lib/asana/resources/custom_field_settings.rb', line 33
def plural_name
'custom_field_settings'
end
|