Module: Sinatra::RhosyncEndpoints

Defined in:
lib/rhosync/endpoints.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) registered(app)



154
155
156
157
158
159
160
161
162
163
# File 'lib/rhosync/endpoints.rb', line 154

def self.registered(app)
  # install our endpoint helpers
  app.send(:include, RhosyncHelpers)

  [:authenticate,:query,:create,:update,:delete].each do |endpoint|
    app.post "/rhosync/#{endpoint}" do
      call_helper(endpoint, request.env['CONTENT_TYPE'], request.body.read)
    end
  end
end