Class: CrowdFlower::Judgment
Instance Attribute Summary collapse
-
#job ⇒ Object
readonly
Returns the value of attribute job.
Attributes inherited from Base
Instance Method Summary collapse
-
#all(page = 1, limit = 100, latest = true) ⇒ Object
Pull every judgment.
- #get(id) ⇒ Object
-
#initialize(job) ⇒ Judgment
constructor
A new instance of Judgment.
- #resource_uri ⇒ Object
Methods inherited from Base
connect, #connect, connect!, connect_config!, connect_domain!, connection, #connection, delete, get, post, put, verify_response
Constructor Details
#initialize(job) ⇒ Judgment
Returns a new instance of Judgment.
5 6 7 8 9 |
# File 'lib/crowdflower/judgment.rb', line 5 def initialize(job) super job.connection @job = job connect end |
Instance Attribute Details
#job ⇒ Object (readonly)
Returns the value of attribute job.
3 4 5 |
# File 'lib/crowdflower/judgment.rb', line 3 def job @job end |
Instance Method Details
#all(page = 1, limit = 100, latest = true) ⇒ Object
Pull every judgment
16 17 18 19 |
# File 'lib/crowdflower/judgment.rb', line 16 def all(page = 1, limit = 100, latest = true) opts = connection.version == 2 ? {:unseen => latest} : {:latest => latest} connection.get(resource_uri, {:query => {:limit => limit, :page => page}.merge(opts)}) end |
#get(id) ⇒ Object
21 22 23 |
# File 'lib/crowdflower/judgment.rb', line 21 def get(id) connection.get("#{resource_uri}/#{id}") end |
#resource_uri ⇒ Object
11 12 13 |
# File 'lib/crowdflower/judgment.rb', line 11 def resource_uri "/jobs/#{@job.id}/judgments" end |