Skip to content

Commit

Permalink
Added more param options to GetReviewableHITs operation
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhale committed Sep 9, 2010
1 parent 131196c commit 25d307b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ mturk.yml
examples/last_hit
pkg
*.sw?
.rvmrc
18 changes: 11 additions & 7 deletions lib/rturk/operations/get_reviewable_hits.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
module RTurk
class GetReviewableHITs < Operation
attr_accessor :page_size, :page_number, :hit_type_id, :status,
:sort_property, :sort_direction

attr_accessor :page_size, :page_number

def parse(xml)
RTurk::GetReviewableHITsResponse.new(xml)
end

def to_params
{
params = {
'PageSize' => (page_size || 100),
'PageNumber' => (page_number || 1)
}
}
params['HITTypeId'] = hit_type_id unless hit_type_id.nil?
params['Status'] = status unless status.nil?
params['SortProperty'] = sort_property unless sort_property.nil?
params['SortDirection'] = sort_direction unless sort_direction.nil?
params
end

end

def self.GetReviewableHITs(*args, &blk)
RTurk::GetReviewableHITs.create(*args, &blk)
end

end

0 comments on commit 25d307b

Please sign in to comment.