Sha256: ce861f125fa799193c8c4b267cc4a24013c7e7ddc5e2255eecffa51781cde354

Contents?: true

Size: 690 Bytes

Versions: 1

Compression:

Stored size: 690 Bytes

Contents

require 'httparty'

module Parse
    module Model
        module Scaffold
          
            class ParseApi
              include HTTParty
              base_uri 'https://api.parse.com/1/classes'

              attr_accessor :options

              def initialize(appId, apiKey)
                headers = {'X-Parse-Application-Id' => appId, 'X-Parse-REST-API-Key' => apiKey}
                self.options = {:headers => headers}
              end

              def get_first(class_name)
                response = self.class.get("/#{class_name}", options.merge({:query => {:limit => 1}}))

                response['results'][0]
              end
            end
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parse-model-scaffold-0.11.0 lib/parse-model-scaffold/parse_api.rb