Class: Kaltura::KalturaLikeService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_plugins/kaltura_like_client_plugin.rb

Overview

Allows user to ‘like’ or ‘unlike’ and entry

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaLikeService

Returns a new instance of KalturaLikeService.



122
123
124
# File 'lib/kaltura_plugins/kaltura_like_client_plugin.rb', line 122

def initialize(client)
	super(client)
end

Instance Method Details

#check_like_exists(entry_id, user_id = KalturaNotImplemented) ⇒ bool

Returns:

  • (bool)


127
128
129
130
131
132
133
134
135
136
# File 'lib/kaltura_plugins/kaltura_like_client_plugin.rb', line 127

def check_like_exists(entry_id, user_id=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'userId', user_id)
	client.queue_service_action_call('like_like', 'checkLikeExists', 'bool', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#like(entry_id) ⇒ bool

Returns:

  • (bool)


139
140
141
142
143
144
145
146
147
# File 'lib/kaltura_plugins/kaltura_like_client_plugin.rb', line 139

def like(entry_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.queue_service_action_call('like_like', 'like', 'bool', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ KalturaLikeListResponse



150
151
152
153
154
155
156
157
158
159
# File 'lib/kaltura_plugins/kaltura_like_client_plugin.rb', line 150

def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'filter', filter)
	client.add_param(kparams, 'pager', pager)
	client.queue_service_action_call('like_like', 'list', 'KalturaLikeListResponse', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#unlike(entry_id) ⇒ bool

Returns:

  • (bool)


162
163
164
165
166
167
168
169
170
# File 'lib/kaltura_plugins/kaltura_like_client_plugin.rb', line 162

def unlike(entry_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.queue_service_action_call('like_like', 'unlike', 'bool', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end