Module: Helpers

Includes:
ObjectActivities, ObjectFolders, UserFolders
Included in:
Mints::User
Defined in:
lib/user/helpers/helpers.rb

Instance Method Summary collapse

Methods included from UserFolders

#create_user_folder, #delete_user_folder, #get_user_folder, #get_user_folders, #update_user_folder

Methods included from ObjectFolders

#create_object_folder, #delete_object_folder, #get_object_folder, #get_object_folders, #update_object_folder

Methods included from ObjectActivities

#create_object_activity, #delete_object_activity, #get_object_activities, #get_object_activity, #update_object_activity

Instance Method Details

#generate_seed(object_type, id) ⇒ Object

Generate seed.

Generate seed using object type and object type id.

Parameters

objectType

(String) – Object type.

id

(Integer) – Object type id.

Example

@data = @mints_user.generate_seed('contacts', 1)

113
114
115
# File 'lib/user/helpers/helpers.rb', line 113

def generate_seed(object_type, id)
  @client.raw('get', "/helpers/seeds/#{object_type}/#{id}")
end

#get_activities_by_object_type_and_id(object_type, id) ⇒ Object

Get activities by object type and id.

Get activities using an object type and object type id.

Parameters

object_type

(String) – Object type.

id

(Integer) – Object type id.

Example

@data = @mints_user.get_activities_by_object_type_and_id('contacts', 1)

62
63
64
# File 'lib/user/helpers/helpers.rb', line 62

def get_activities_by_object_type_and_id(object_type, id)
  @client.raw('get', "/helpers/activities/#{object_type}/#{id}")
end

#get_available_types_from_usage(usage) ⇒ Object

Get available types from usage.

Get available types by usage.

Parameters

usage

() – …


35
36
37
38
# File 'lib/user/helpers/helpers.rb', line 35

def get_available_types_from_usage(usage)
  # TODO: Research use
  @client.raw('get', "/helpers/available-types/#{usage}")
end

#get_dice_coefficient(options) ⇒ Object

Get dice coefficient.

Get dice coefficient.

Parameters

options

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

Example

options = {
  table: 'contacts',
  field: 'id',
  word: '1'
}
@data = @mints_user.get_dice_coefficient(options)

83
84
85
# File 'lib/user/helpers/helpers.rb', line 83

def get_dice_coefficient(options)
  @client.raw('get', '/helpers/dice-coefficient', options)
end

Get magic link config.

Get config used in magic links.

Example

@data = @mints_user.get_magic_link_config

45
46
47
# File 'lib/user/helpers/helpers.rb', line 45

def get_magic_link_config
  @client.raw('get', '/helpers/magic-link-config')
end

#get_permission_menuObject

Get permission menu.

Get permission menu.

Example

@data = @mints_user.get_permission_menu

96
97
98
# File 'lib/user/helpers/helpers.rb', line 96

def get_permission_menu
  @client.raw('get', '/helpers/menu')
end

#slugify(data) ⇒ Object

Slugify.

Slugify a text using an object type.

Parameters

data

(Hash) – Data to be submitted.

Example


24
25
26
27
# File 'lib/user/helpers/helpers.rb', line 24

def slugify(data)
  # TODO: Research use of variable polymorphicObjectType
  @client.raw('post', '/helpers/slugify', nil, data_transform(data))
end