Sha256: ecf5ef4ee193f13e71c9fd4a6c18e2343073e78f63fb3b961e9baddec06498ef

Contents?: true

Size: 436 Bytes

Versions: 12

Compression:

Stored size: 436 Bytes

Contents

Server.api :list_sources do |params,user|
  sources = App.load(APP_NAME).sources.members
  if params[:partition_type].nil? or params[:partition_type] == 'all'
    sources.to_json 
  else
    res = []
    sources.each do |name|
      s = Source.load(name,{:app_id => APP_NAME,:user_id => '*'})
      if s.partition_type and s.partition_type == params[:partition_type]
        res << name 
      end
    end  
    res.to_json
  end  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rhosync-2.1.3 lib/rhosync/api/list_sources.rb
rhosync-2.1.2 lib/rhosync/api/list_sources.rb
rhosync-2.1.1 lib/rhosync/api/list_sources.rb
rhosync-2.1.0 lib/rhosync/api/list_sources.rb
rhosync-2.1.0.beta.2 lib/rhosync/api/list_sources.rb
rhosync-2.1.0.beta.1 lib/rhosync/api/list_sources.rb
rhosync-2.0.9 lib/rhosync/api/list_sources.rb
rhosync-2.0.8 lib/rhosync/api/list_sources.rb
rhosync-2.0.7 lib/rhosync/api/list_sources.rb
rhosync-2.0.6 lib/rhosync/api/list_sources.rb
rhosync-2.0.5 lib/rhosync/api/list_sources.rb
rhosync-2.0.4 lib/rhosync/api/list_sources.rb