forked from ryantate/rturk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more param options to GetReviewableHITs operation
- Loading branch information
Showing
2 changed files
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ mturk.yml | |
examples/last_hit | ||
pkg | ||
*.sw? | ||
.rvmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |