Sha256: 04a8742342e0e674d54d6d0f3c85028c4156bbf8b67622918dd4946899f84ed5

Contents?: true

Size: 1.15 KB

Versions: 24

Compression:

Stored size: 1.15 KB

Contents

# Parses the GetQualificationType Response

module RTurk
  class GetQualificationTypeResponse < Response
    attr_reader :qualification_type_id, :creation_time, :name, :description,
                :keywords, :status, :retry_delay_in_seconds, :is_requestable,
                :test, :test_duration_in_seconds, :answer_key, :auto_granted,
                :auto_granted_value

    def initialize(response)
      @raw_xml = response.body
      @xml = Nokogiri::XML(@raw_xml)
      raise_errors
      map_content(@xml.xpath('//QualificationType'),
        :qualification_type_id => 'QualificationTypeId',
        :creation_time => 'CreationTime',
        :name => 'Name',
        :description => 'Description',
        :keywords => 'Keywords',
        :status => 'QualificationTypeStatus',
        :retry_delay_in_seconds => 'RetryDelayInSeconds',
        :is_requestable => 'IsRequestable',
        :test => 'Test',
        :test_duration_in_seconds => 'TestDurationInSeconds',
        :answer_key => 'AnswerKey',
        :auto_granted => 'AutoGranted',
        :auto_granted_value => 'AutoGrantedValue'
      )

      @keywords = @keywords.split(', ') if @keywords
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rturk-2.3.4 lib/rturk/parsers/responses/get_qualification_type_response.rb
rturk-2.3.3 lib/rturk/parsers/responses/get_qualification_type_response.rb
rturk-2.3.2 lib/rturk/parsers/responses/get_qualification_type_response.rb
rturk-2.3.1 lib/rturk/parsers/responses/get_qualification_type_response.rb