iucnredlistrb 0.1.2 → 0.1.3
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/lib/iucnredlistrb/client.rb +4 -0
- data/lib/iucnredlistrb/taxa.rb +26 -0
- data/lib/iucnredlistrb/version.rb +1 -1
- data/lib/iucnredlistrb.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2376b1613b973372965c570de1a708b6d89704dca62aa98adc75160c47b8a0d3
|
|
4
|
+
data.tar.gz: b742835c688dbdd6829fc5668df9ca89bd2eb6d11c96ba060f582f78428a74d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 587cae87f9ed0ab2c4bad275132945341ef0cd6e39a412beef9ae9839de1d761551aaf6306c543a9c7cfe1e6355b1b63b7406e998783a5876a8de1c919c532c3
|
|
7
|
+
data.tar.gz: ed98316cb2c35806720d5a391a6d915e09a58e16694733b919472b4c273d157a79af0cbda12de09d237efb9c1337ef877582f88bf94320210943f985573ee651
|
data/lib/iucnredlistrb/client.rb
CHANGED
|
@@ -30,6 +30,10 @@ module IUCNRedListRb
|
|
|
30
30
|
@assessment ||= IUCNRedListRb::Assessment.new(self)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
def taxa
|
|
34
|
+
@taxa ||= IUCNRedListRb::Taxa.new(self)
|
|
35
|
+
end
|
|
36
|
+
|
|
33
37
|
RESOURCE_NAMES.each do |resource_name|
|
|
34
38
|
define_method(resource_name) do
|
|
35
39
|
instance_variable_get("@#{resource_name}") ||
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IUCNRedListRb
|
|
4
|
+
class Taxa
|
|
5
|
+
def initialize(client)
|
|
6
|
+
@client = client
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
TAXA_LEVELS = %w[
|
|
10
|
+
kingdom
|
|
11
|
+
phylum
|
|
12
|
+
class
|
|
13
|
+
order
|
|
14
|
+
family
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
TAXA_LEVELS.each do |taxa_level|
|
|
18
|
+
define_method(taxa_level) do
|
|
19
|
+
instance_variable_get("@#{taxa_level}") ||
|
|
20
|
+
instance_variable_set(
|
|
21
|
+
"@#{taxa_level}", IUCNRedListRb::Resource.new(@client, "taxa/#{taxa_level}")
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
data/lib/iucnredlistrb.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: iucnredlistrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ian Townsend
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-04-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -36,6 +36,7 @@ files:
|
|
|
36
36
|
- lib/iucnredlistrb/assessment.rb
|
|
37
37
|
- lib/iucnredlistrb/client.rb
|
|
38
38
|
- lib/iucnredlistrb/resource.rb
|
|
39
|
+
- lib/iucnredlistrb/taxa.rb
|
|
39
40
|
- lib/iucnredlistrb/version.rb
|
|
40
41
|
homepage: https://github.com/IUCN-UK/iucnredlistrb
|
|
41
42
|
licenses:
|