5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/ext_direct/service/configuration.rb', line 5
def generate(route_path)
config = {}
config['url'] = route_path
config['type'] = "remoting"
config['actions'] = {}
services = ExtDirect::Service::Provider.fetch
services.each do |action,methods|
action = normalize_action(action)
config['actions'][action] = []
methods.each do |method,properties|
next unless properties[:type] == :remoting
params = {}
properties[:params].each do |key,value|
params[normalize_key(key)] = value
end
config['actions'][action] << {
:name => normalize_method(method),
:len => 1
}.merge(params)
end
end
config
end
|