Module: Profile

Included in:
Mints::User
Defined in:
lib/user/profile/profile.rb

Instance Method Summary collapse

Instance Method Details

#create_preferences(data) ⇒ Object

Create preferences.

Create preferences of current user logged with data.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  "time_zone": "GMT-5"
}
@data = @mints_user.create_preferences(data)
[View source]

38
39
40
# File 'lib/user/profile/profile.rb', line 38

def create_preferences(data)
    return @client.raw("post", "/profile/preferences", nil, data_transform(data))
end

#delete_notifications(data) ⇒ Object

Delete notifications.

Delete notifications by data.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  "ids": ["179083e3-3678-4cf6-b75e-5a8b9761245e"]
}
@data = @mints_user.delete_notifications(data)
[View source]

106
107
108
109
110
# File 'lib/user/profile/profile.rb', line 106

def delete_notifications(data)
    #TODO: Inform NotificationController.delete method has been modified
    #TODO: Method in controller didnt return data
    return @client.raw("post", "/profile/notifications/delete", nil, data_transform(data))
end

#get_notificationsObject

Get notifications.

Get a collection of notifications.

Example

@data = @mints_user.get_notifications
[View source]

64
65
66
# File 'lib/user/profile/profile.rb', line 64

def get_notifications
    return @client.raw("get", "/profile/notifications")
end

#get_paginated_notificationsObject

Get paginated notifications.

Get a collection of paginated notifications.

Example

@data = @mints_user.get_paginated_notifications
[View source]

73
74
75
# File 'lib/user/profile/profile.rb', line 73

def get_paginated_notifications
    return @client.raw("get", "/profile/notificationsp")
end

#get_preferencesObject

Get preferences.

Get preferences of current user logged.

Example

@data = @mints_user.get_preferences
[View source]

22
23
24
# File 'lib/user/profile/profile.rb', line 22

def get_preferences
    return @client.raw("get", "/profile/preferences")
end

#get_preferences_by_setting_key(setting_key) ⇒ Object

Get preferences by setting key.

Get preferences using a setting key.

Parameters

setting_key

(String) – Setting key.

Example

@data = @mints_user.get_preferences_by_setting_key("time_zone")
[View source]

51
52
53
# File 'lib/user/profile/profile.rb', line 51

def get_preferences_by_setting_key(setting_key)
    return @client.raw("get", "/profile/preferences/#{setting_key}")
end

#me(options = nil) ⇒ Object

Me.

Get contact logged info.

Example

@data = @mints_user.me
[View source]

8
9
10
# File 'lib/user/profile/profile.rb', line 8

def me(options = nil)
    return @client.raw("get", "/profile/me", options)
end

#read_notifications(data) ⇒ Object

Read notifications.

Read notifications by data.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  "ids": ["406e9b74-4a9d-42f2-afc6-1587bad6147c", "a2d9f582-1bdb-4e55-8af0-cd1962eaa88c"],
  "read": true
}
@data = @mints_user.read_notifications(data)
[View source]

89
90
91
92
93
# File 'lib/user/profile/profile.rb', line 89

def read_notifications(data)
    #TODO: Inform NotificationController.read method has been modified
    #TODO: Method in controller didnt return data
    return @client.raw("post", "/profile/notifications/read", nil, data_transform(data))
end