Sha256: d348c6546c8a4ea00102c8ccc0abf5bb63fb55cc6407e9d48d5baa7a76dd8c32

Contents?: true

Size: 353 Bytes

Versions: 1

Compression:

Stored size: 353 Bytes

Contents

require 'json'

module Parse
  class Batch
    attr_reader :requests

    def initialize
      @requests ||= []
    end

    def add_request(request)
      @requests << request
    end

    def run!
      uri = Parse::Protocol.batch_request_uri
      body = {:requests => @requests}.to_json
      Parse.client.request(uri, :post, body)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parse-ruby-client-0.1.8 lib/parse/batch.rb