Module: CrowdFlower
- Defined in:
- lib/ruby-crowdflower/job.rb,
lib/ruby-crowdflower/base.rb,
lib/ruby-crowdflower/unit.rb,
lib/ruby-crowdflower/order.rb,
lib/ruby-crowdflower/judgment.rb
Defined Under Namespace
Modules: Defaults
Classes: Job, Judgment, Order, Unit
Constant Summary
collapse
- @@key =
nil
- @@domain =
nil
Class Method Summary
collapse
Class Method Details
.connect!(key, development = false) ⇒ Object
13
14
15
16
|
# File 'lib/ruby-crowdflower/base.rb', line 13
def self.connect!(key, development = false)
@@domain = development ? "http://api.localhost:4000/v1" : "https://api.crowdflower.com/v1"
@@key = key
end
|
.key ⇒ Object
23
24
25
26
|
# File 'lib/ruby-crowdflower/base.rb', line 23
def self.key
raise "Please establish a connection using 'CrowdFlower.connect!'" unless @@key
{:key => @@key}
end
|
.with_domain(path) ⇒ Object
18
19
20
21
|
# File 'lib/ruby-crowdflower/base.rb', line 18
def self.with_domain(path)
raise "Please establish a connection using 'CrowdFlower.connect!'" unless @@domain
@@domain + path
end
|