idigbio_client 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +14 -9
- data/idigbio_client.gemspec +2 -0
- data/lib/idigbio_client/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62fa6773f6c3978b6f0178460be1ab11cbc74e0b
|
4
|
+
data.tar.gz: 306805ac056273c5a5f70776fc2796e9adb1444a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ff4f93d2833bbda8c75e810a997b9f37c90f88b21619aa4545dc33e0aced10ba5136279eadcf671f3e5cd0ad6ec115bfbdfc12cd573f7e3f57965a8bfd94937
|
7
|
+
data.tar.gz: 3be8cf4fc68036a5bdae33d5d4066d7357d9fba5dcadc0ac661d85323cdef563d5d266869ee82c954aeaa7dba3533388e16b8b517accaabfb97f511b5dd86c6e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -31,7 +31,7 @@ Or install it yourself as:
|
|
31
31
|
Usage
|
32
32
|
-----
|
33
33
|
|
34
|
-
Client functions can be grouped in 4
|
34
|
+
Client functions can be grouped in 4 categories
|
35
35
|
|
36
36
|
* [inspect][inspect] - introspective methods
|
37
37
|
* [search][search] - search by provided parameters
|
@@ -51,9 +51,10 @@ Returns an array of types (resources) available via API.
|
|
51
51
|
require "idigbio_client"
|
52
52
|
|
53
53
|
IdigbioClient.types
|
54
|
+
# returns ["records", "mediarecords", "recordsets", "publishers"]
|
54
55
|
```
|
55
56
|
|
56
|
-
#### Method `IdigbioClient.fields(type)
|
57
|
+
#### Method `IdigbioClient.fields(type)`
|
57
58
|
|
58
59
|
Returns a hash with description of fields associated with a resource. Takes one
|
59
60
|
optional parameter `type`. If type is not given it returns fields to all types
|
@@ -86,18 +87,22 @@ Takes a hash of opts, returns a hash with results of a search.
|
|
86
87
|
|
87
88
|
##### params
|
88
89
|
|
89
|
-
|
|
90
|
-
|
91
|
-
| :rq
|
92
|
-
| :limit
|
93
|
-
| :offset
|
90
|
+
| params.keys | Description |
|
91
|
+
|-------------|------------------------------------------------------|
|
92
|
+
| :rq | search query hash; *default* `{}` |
|
93
|
+
| :limit | how many records to return in total; *default* `100` |
|
94
|
+
| :offset | from which record to start; *default* `0` |
|
94
95
|
|
95
96
|
```ruby
|
96
97
|
require "idigbio_client"
|
97
98
|
|
98
99
|
# specimen records search
|
99
100
|
params = { rq: { genus: "acer" }, limit: 15 }
|
100
|
-
IdigbioClient.search(
|
101
|
+
IdigbioClient.search(params: params)
|
102
|
+
|
103
|
+
# setting offset: will return only 5 records, assuming 10 were done before
|
104
|
+
params = { rq: { genus: "acer" }, limit: 15, offset: 10 }
|
105
|
+
IdigbioClient.search(params: params)
|
101
106
|
|
102
107
|
# using non-default type
|
103
108
|
IdigbioClient.search(type: :mediarecords, params: params)
|
@@ -128,7 +133,7 @@ Returns the number of records of a specified type
|
|
128
133
|
| opts.keys | Type | Description |
|
129
134
|
|------------|------------------|----------------------------------------|
|
130
135
|
| :type | String or Symbol | resource type; *default* `:records` |
|
131
|
-
| :params | search options hash; *default* `{}`
|
136
|
+
| :params | Hash | search options hash; *default* `{}` |
|
132
137
|
|
133
138
|
```ruby
|
134
139
|
require "idigbio_client"
|
data/idigbio_client.gemspec
CHANGED
@@ -4,6 +4,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require "idigbio_client/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
|
+
gem.license = "MIT"
|
8
|
+
gem.required_ruby_version = ">= 1.9.0"
|
7
9
|
gem.name = "idigbio_client"
|
8
10
|
gem.version = IdigbioClient::VERSION
|
9
11
|
gem.authors = ["Greg T.", "Dmitry Mozzherin"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idigbio_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg T.
|
@@ -135,7 +135,8 @@ files:
|
|
135
135
|
- lib/idigbio_client/search.rb
|
136
136
|
- lib/idigbio_client/version.rb
|
137
137
|
homepage: https://github.com/GlobalNamesArchitecture/idigbio-ruby-client
|
138
|
-
licenses:
|
138
|
+
licenses:
|
139
|
+
- MIT
|
139
140
|
metadata: {}
|
140
141
|
post_install_message:
|
141
142
|
rdoc_options: []
|
@@ -145,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
146
|
requirements:
|
146
147
|
- - ">="
|
147
148
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
149
|
+
version: 1.9.0
|
149
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
151
|
requirements:
|
151
152
|
- - ">="
|