Class: ExtDirect::Service::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/ext_direct/service/configuration.rb

Class Method Summary collapse

Class Method Details

.generate(route_path) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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,params|
      config['actions'][action] << {:name => normalize_method(method), :len => 1} if params[:type] == :remoting
    end
  end
  
  config
end