Module: AttributeGroups

Included in:
Config
Defined in:
lib/user/config/attribute_groups.rb

Instance Method Summary collapse

Instance Method Details

#create_attribute_group(data) ⇒ Object

Create attribute group.

Create an attribute group with data.

Parameters

data

(Hash) – Data to be submited.

Example

data = {
  "title": "New Attribute Group",
  "object_type": "contacts"
}
@data = @mints_user.create_attribute_group(data)


55
56
57
# File 'lib/user/config/attribute_groups.rb', line 55

def create_attribute_group(data)
    return @client.raw("post", "/config/attribute-groups", nil, data_transform(data))
end

#get_attribute_group(id) ⇒ Object

Get attribute group.

Get an attribute group info.

Parameters

id

(Integer) – Attribute group id.

Example

@data = @mints_user.get_attribute_group(10)


39
40
41
# File 'lib/user/config/attribute_groups.rb', line 39

def get_attribute_group(id)
    return @client.raw("get", "/config/attribute-groups/#{id}")
end

#get_attribute_groups(options = nil) ⇒ Object

Get attribute groups.

Get a collection of attribute groups.

Parameters

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @mints_user.get_attribute_groups

Second Example

options = { "sort": "id" }
@data = @mints_user.get_attribute_groups(options)


27
28
29
# File 'lib/user/config/attribute_groups.rb', line 27

def get_attribute_groups(options = nil)
    return @client.raw("get", "/config/attribute-groups", options)
end

#get_attribute_groups_data_typesObject

Get attribute groups data types.

Get data types used in attribute groups.

Example

@data = @mints_user.get_attribute_groups_data_types


11
12
13
# File 'lib/user/config/attribute_groups.rb', line 11

def get_attribute_groups_data_types
    return @client.raw("get", "/config/attribute-groups/object-types")
end

#update_attribute_group(id, data) ⇒ Object

Update attribute group.

Update an attribute group info.

Parameters

id

(Integer) – Attribute group id.

data

(Hash) – Data to be submited.

Example

data = {
  "title": "New Attribute Group Modified",
  "object_type": "contacts",
  "slug": "new-attribute-group",
  "description": "New description"
}
@data = @mints_user.update_attribute_group(36, data)


74
75
76
# File 'lib/user/config/attribute_groups.rb', line 74

def update_attribute_group(id, data)
    return @client.raw("put", "/config/attribute-groups/#{id}", nil, data_transform(data))
end