6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/stimul8/component/actions.rb', line 6
def action action_name, parameters = {}
action = if (event = parameters.delete(:event))
"#{event}->stimul8#callAction"
elsif (events = parameters.delete(:events))
Array.wrap(events).map { |e| "#{e}->stimul8#callAction" }.join(" ")
else
"stimul8#callAction"
end
data = {action: action, stimul8_action_param: action_name.to_s}
parameters.each do |name, value|
data[:"stimul8_#{name.to_s.underscore}_param"] = value
end
{data: data}
end
|