Sha256: 543198d37fe7f075227d9bbe7fc8594e0ac794aedd125d74aff3cb2d8c580eed

Contents?: true

Size: 681 Bytes

Versions: 3

Compression:

Stored size: 681 Bytes

Contents

# Parses out the CreateHIT response
#
# Example response:
# <CreateHITResponse>
#   <OperationRequest>
#     <RequestId>ece2785b-6292-4b12-a60e-4c34847a7916</RequestId>
#   </OperationRequest>
#   <HIT>
#     <Request>
#       <IsValid>True</IsValid>
#     </Request>
#     <HITId>GBHZVQX3EHXZ2AYDY2T0</HITId>
#     <HITTypeId>NYVZTQ1QVKJZXCYZCZVZ</HITTypeId>
#   </HIT>
# </CreateHITResponse>

module RTurk
  class CreateHITResponse < Response
    
    def hit_id
      @xml.xpath('//HITId').inner_text
    end
      
    def hit_type_id
      @xml.xpath('//HITTypeId').inner_text
    end
    
    def hit
      RTurk::Hit.new(self.hit_id, self.hit_type_id)
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rturk-2.0.2 lib/rturk/responses/create_hit_response.rb
rturk-2.0.1 lib/rturk/responses/create_hit_response.rb
rturk-2.0.0 lib/rturk/responses/create_hit_response.rb