Module: CloudConnect::Client::Fields
- Included in:
- CloudConnect::Client
- Defined in:
- lib/cloud_connect/client/fields.rb
Defined Under Namespace
Modules: FieldMethods
Instance Method Summary collapse
-
#create_field(name, options = {}) ⇒ Field
Create a field.
-
#delete_field(name, options = {}) ⇒ Response
Delete a single field.
-
#field(name, options = {}) ⇒ Field
Get a field.
-
#fields(options = {}) ⇒ Array
(also: #list_fields)
Get fields.
-
#search_fields(search_term, options = {}) ⇒ Array
Search fields.
-
#update_field(name, options = {}) ⇒ Field
Update an field.
Instance Method Details
#create_field(name, options = {}) ⇒ Field
Create a field
55 56 57 |
# File 'lib/cloud_connect/client/fields.rb', line 55 def create_field(name, ={}) enhance( post("fields", .merge({:name => name})), with: FieldMethods ) end |
#delete_field(name, options = {}) ⇒ Response
Delete a single field
85 86 87 |
# File 'lib/cloud_connect/client/fields.rb', line 85 def delete_field(name, ={}) delete("fields/#{name}", , true) end |
#field(name, options = {}) ⇒ Field
Get a field
13 14 15 |
# File 'lib/cloud_connect/client/fields.rb', line 13 def field(name, ={}) enhance( get("fields/#{name}", ), with: FieldMethods ) end |
#fields(options = {}) ⇒ Array Also known as: list_fields
Get fields
36 37 38 |
# File 'lib/cloud_connect/client/fields.rb', line 36 def fields(={}) enhance( get("fields", ), with: FieldMethods ) end |
#search_fields(search_term, options = {}) ⇒ Array
Search fields
25 26 27 |
# File 'lib/cloud_connect/client/fields.rb', line 25 def search_fields(search_term, ={}) enhance( get("fields?q=#{search_term}", ), with: FieldMethods ) end |
#update_field(name, options = {}) ⇒ Field
Update an field
73 74 75 |
# File 'lib/cloud_connect/client/fields.rb', line 73 def update_field(name, ={}) enhance( put("/fields/#{name}", .merge({:name => name})), with: FieldMethods ) end |