Class: Eol::Hierarchies
- Inherits:
-
Object
- Object
- Eol::Hierarchies
- Includes:
- Enumerable
- Defined in:
- lib/eol/hierarchies.rb
Overview
Contains metadata about a hierarchy such as the provider name and source URL, as well as lists all the taxa which are the root taxa of the taxonomic tree
Instance Attribute Summary collapse
-
#contributor ⇒ String
The name of the Hierarchies contributor.
-
#date_submitted ⇒ String
Date of submission.
-
#roots ⇒ Array
An Array of Hashes.
-
#source ⇒ String
The Hierarchies source.
-
#title ⇒ String
The Hierarchies title.
Instance Method Summary collapse
- #each {|@title| ... } ⇒ Object
-
#initialize(response) ⇒ Hierarchies
constructor
A new instance of Hierarchies.
Constructor Details
#initialize(response) ⇒ Hierarchies
Returns a new instance of Hierarchies.
19 20 21 22 23 24 25 |
# File 'lib/eol/hierarchies.rb', line 19 def initialize(response) self.title = response['title'] self.contributor = response['contributor'] self.date_submitted = response['dateSubmitted'] self.source = response['source'] self.roots = response['roots'] end |
Instance Attribute Details
#contributor ⇒ String
Returns the name of the Hierarchies contributor.
11 12 13 |
# File 'lib/eol/hierarchies.rb', line 11 def contributor @contributor end |
#date_submitted ⇒ String
Returns date of submission.
13 14 15 |
# File 'lib/eol/hierarchies.rb', line 13 def date_submitted @date_submitted end |
#roots ⇒ Array
Returns An Array of Hashes.
17 18 19 |
# File 'lib/eol/hierarchies.rb', line 17 def roots @roots end |
#source ⇒ String
Returns the Hierarchies source.
15 16 17 |
# File 'lib/eol/hierarchies.rb', line 15 def source @source end |
#title ⇒ String
Returns the Hierarchies title.
9 10 11 |
# File 'lib/eol/hierarchies.rb', line 9 def title @title end |
Instance Method Details
#each {|@title| ... } ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/eol/hierarchies.rb', line 27 def each yield @title yield @contributor yield @date_submitted yield @source yield @roots end |