Module: Profile
- Included in:
- Mints::User
- Defined in:
- lib/user/profile/profile.rb
Instance Method Summary collapse
-
#create_preferences(data) ⇒ Object
Create preferences.
-
#delete_notifications(data) ⇒ Object
Delete notifications.
-
#get_notifications ⇒ Object
Get notifications.
-
#get_paginated_notifications ⇒ Object
Get paginated notifications.
-
#get_preferences ⇒ Object
Get preferences.
-
#get_preferences_by_setting_key(setting_key) ⇒ Object
Get preferences by setting key.
-
#me(options = nil) ⇒ Object
Me.
-
#read_notifications(data) ⇒ Object
Read notifications.
Instance Method Details
permalink #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)
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 |
permalink #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)
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 |
permalink #get_notifications ⇒ Object
Get notifications.
Get a collection of notifications.
Example
@data = @mints_user.get_notifications
64 65 66 |
# File 'lib/user/profile/profile.rb', line 64 def get_notifications return @client.raw("get", "/profile/notifications") end |
permalink #get_paginated_notifications ⇒ Object
Get paginated notifications.
Get a collection of paginated notifications.
Example
@data = @mints_user.get_paginated_notifications
73 74 75 |
# File 'lib/user/profile/profile.rb', line 73 def get_paginated_notifications return @client.raw("get", "/profile/notificationsp") end |
permalink #get_preferences ⇒ Object
Get preferences.
Get preferences of current user logged.
Example
@data = @mints_user.get_preferences
22 23 24 |
# File 'lib/user/profile/profile.rb', line 22 def get_preferences return @client.raw("get", "/profile/preferences") end |
permalink #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")
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 |
permalink #me(options = nil) ⇒ Object
Me.
Get contact logged info.
Example
@data = @mints_user.me
8 9 10 |
# File 'lib/user/profile/profile.rb', line 8 def me( = nil) return @client.raw("get", "/profile/me", ) end |
permalink #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)
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 |