assaydepot 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,11 @@
1
- # AssayDepot
1
+ # Assay Depot
2
2
 
3
3
  Ruby interface for Assay Depot's online laboratory (http://www.assaydepot.com).
4
4
 
5
+ ## Assay Depot Developer Program
6
+
7
+ An authentication token is required for the API to function. If you would like access to the API, please email cpetersen@assaydepot.com.
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -21,8 +25,8 @@ Or install it yourself as:
21
25
  ```ruby
22
26
  require 'assaydepot'
23
27
  AssayDepot.configure do |config|
24
- config.auth_token = "1234567890"
25
- config.url = "http://localhost:3000/api"
28
+ config.access_token = "1234567890"
29
+ config.url = "https://www.assaydepot.com/api"
26
30
  end
27
31
  wares = AssayDepot::Ware.find("Antibody")
28
32
  wares.total
@@ -45,7 +49,7 @@ wares.first["name"]
45
49
  ## Providers
46
50
 
47
51
  ```ruby
48
- providers = AssayDepot::Provider.where(:starts_with => "a").per_page(600)
52
+ providers = AssayDepot::Provider.where(:starts_with => "a").per_page(50)
49
53
  providers.count
50
54
  ```
51
55
 
@@ -7,7 +7,7 @@ module AssayDepot
7
7
  @search_type = options[:search_type] || "wares"
8
8
  end
9
9
 
10
- def search_url(query, facets, params={})
10
+ def search_url(params={})
11
11
  "#{AssayDepot.url}/#{@search_type}.json?#{params.collect { |k,v| "#{k}=#{v.to_s.gsub(" ","+")}"}.join("&")}"
12
12
  end
13
13
 
@@ -16,16 +16,16 @@ module AssayDepot
16
16
  end
17
17
 
18
18
  def search(query, facets, params={})
19
- params["auth_token"] = AssayDepot.auth_token
19
+ params["access_token"] = AssayDepot.access_token
20
20
  params["q"] = query
21
21
  facets.map do |name,value|
22
22
  params["facets[#{name}][]"] = value
23
23
  end
24
- JSON.parse(open(search_url(query, facets, params)).read)
24
+ JSON.parse(open(search_url(params)).read)
25
25
  end
26
26
 
27
27
  def get(id, params={})
28
- params["auth_token"] = AssayDepot.auth_token
28
+ params["access_token"] = AssayDepot.access_token
29
29
  JSON.parse(open(get_url(id, params)).read)
30
30
  end
31
31
  end
@@ -9,7 +9,7 @@ module AssayDepot
9
9
 
10
10
  CONFIG_KEYS = [
11
11
  :url,
12
- :auth_token,
12
+ :access_token,
13
13
  ] unless defined? CONFIG_KEYS
14
14
  attr_accessor *CONFIG_KEYS
15
15
 
@@ -1,3 +1,3 @@
1
1
  module AssayDepot
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assaydepot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-12 00:00:00.000000000 Z
12
+ date: 2012-08-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json