Sha256: 2f589d8ef52fcf3845bf8ed3fe2953be4b9e644c063eaf777a6ca10a02934161

Contents?: true

Size: 934 Bytes

Versions: 5

Compression:

Stored size: 934 Bytes

Contents

module BlockScore
  class QuestionSet

    def initialize(client)
      @client = client
    end

    def create(verification_id, options = {})
      body = (options.include? :body) ? options[:body] : {}
      body[:verification_id] = verification_id

      response = @client.post '/questions', body
    end

    # 
    # '/questions/:id/score' POST
    #
    # answers - 
    def score(id, answers)
    	body = {}
      body[:answers] = answers

			response = @client.post "/questions/#{id.to_s}/score", body
		end

		# 
		# /questions/:id GET
		#
		# question_set_id -
		# verification_id -
		def retrieve(id)
			body = Hash.new

			response = @client.get "/questions/#{id.to_s}", body
		end

		# 
		# '/questions' GET
		#
		def all(count = nil, offset = nil, options = {})
			body = (options.include? :body) ? options[:body] : {}

			body[:count] = count
			body[:offset] = offset

			@client.get '/questions', body
		end
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blockscore-3.0.1 lib/blockscore/question_set.rb
blockscore-3.0.0 lib/blockscore/question_set.rb
blockscore-2.1.2 lib/blockscore/question_set.rb
blockscore-2.1.1 lib/blockscore/question_set.rb
blockscore-2.1.0 lib/blockscore/question_set.rb