Class: Kaltura::KalturaRatingService

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

Overview

Allows user to manipulate their entry rating

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaRatingService

Returns a new instance of KalturaRatingService.



104
105
106
# File 'lib/kaltura_plugins/kaltura_rating_client_plugin.rb', line 104

def initialize(client)
	super(client)
end

Instance Method Details

#check_rating(entry_id) ⇒ int

Returns:

  • (int)


109
110
111
112
113
114
115
116
117
# File 'lib/kaltura_plugins/kaltura_rating_client_plugin.rb', line 109

def check_rating(entry_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.queue_service_action_call('rating_rating', 'checkRating', 'int', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#get_rating_counts(filter) ⇒ KalturaRatingCountListResponse



120
121
122
123
124
125
126
127
128
# File 'lib/kaltura_plugins/kaltura_rating_client_plugin.rb', line 120

def get_rating_counts(filter)
	kparams = {}
	client.add_param(kparams, 'filter', filter)
	client.queue_service_action_call('rating_rating', 'getRatingCounts', 'KalturaRatingCountListResponse', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#rate(entry_id, rank) ⇒ int

Returns:

  • (int)


131
132
133
134
135
136
137
138
139
140
# File 'lib/kaltura_plugins/kaltura_rating_client_plugin.rb', line 131

def rate(entry_id, rank)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'rank', rank)
	client.queue_service_action_call('rating_rating', 'rate', 'int', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#remove_rating(entry_id) ⇒ bool

Returns:

  • (bool)


143
144
145
146
147
148
149
150
151
# File 'lib/kaltura_plugins/kaltura_rating_client_plugin.rb', line 143

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