Class: Kaltura::KalturaPollService

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

Overview

Poll service

The poll service works against the cache entirely no DB instance should be used here

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaPollService

Returns a new instance of KalturaPollService.



36
37
38
# File 'lib/kaltura_plugins/kaltura_poll_client_plugin.rb', line 36

def initialize(client)
	super(client)
end

Instance Method Details

#add(poll_type = 'SINGLE_ANONYMOUS') ⇒ string

Add Action

Returns:

  • (string)


42
43
44
45
46
47
48
49
50
# File 'lib/kaltura_plugins/kaltura_poll_client_plugin.rb', line 42

def add(poll_type='SINGLE_ANONYMOUS')
	kparams = {}
	client.add_param(kparams, 'pollType', poll_type)
	client.queue_service_action_call('poll_poll', 'add', 'string', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#get_vote(poll_id, user_id) ⇒ string

Vote Action

Returns:

  • (string)


54
55
56
57
58
59
60
61
62
63
# File 'lib/kaltura_plugins/kaltura_poll_client_plugin.rb', line 54

def get_vote(poll_id, user_id)
	kparams = {}
	client.add_param(kparams, 'pollId', poll_id)
	client.add_param(kparams, 'userId', user_id)
	client.queue_service_action_call('poll_poll', 'getVote', 'string', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#get_votes(poll_id, answer_ids) ⇒ string

Get Votes Action

Returns:

  • (string)


67
68
69
70
71
72
73
74
75
76
# File 'lib/kaltura_plugins/kaltura_poll_client_plugin.rb', line 67

def get_votes(poll_id, answer_ids)
	kparams = {}
	client.add_param(kparams, 'pollId', poll_id)
	client.add_param(kparams, 'answerIds', answer_ids)
	client.queue_service_action_call('poll_poll', 'getVotes', 'string', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#reset_votes(poll_id) ⇒ Object

Get resetVotes Action

Returns:



80
81
82
83
84
85
86
87
88
# File 'lib/kaltura_plugins/kaltura_poll_client_plugin.rb', line 80

def reset_votes(poll_id)
	kparams = {}
	client.add_param(kparams, 'pollId', poll_id)
	client.queue_service_action_call('poll_poll', 'resetVotes', '', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#vote(poll_id, user_id, answer_ids) ⇒ string

Vote Action

Returns:

  • (string)


92
93
94
95
96
97
98
99
100
101
102
# File 'lib/kaltura_plugins/kaltura_poll_client_plugin.rb', line 92

def vote(poll_id, user_id, answer_ids)
	kparams = {}
	client.add_param(kparams, 'pollId', poll_id)
	client.add_param(kparams, 'userId', user_id)
	client.add_param(kparams, 'answerIds', answer_ids)
	client.queue_service_action_call('poll_poll', 'vote', 'string', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end