Class: Eol::Search
Overview
Contains search results from the Encyclopedia of Life database.
Instance Attribute Summary collapse
-
#content ⇒ String
Classification content.
-
#id ⇒ Integer
The id of the species.
-
#link ⇒ String
Link to article on the EOL homepage.
-
#title ⇒ String
Title of the entry.
Instance Method Summary collapse
- #each {|@id| ... } ⇒ Object
-
#initialize(response) ⇒ Search
constructor
A new instance of Search.
Constructor Details
#initialize(response) ⇒ Search
Returns a new instance of Search.
16 17 18 19 20 21 |
# File 'lib/eol/search.rb', line 16 def initialize(response) self.id = response['id'] self.title = response['title'] self.link = response['link'] self.content = response['content'] end |
Instance Attribute Details
#content ⇒ String
Returns classification content.
14 15 16 |
# File 'lib/eol/search.rb', line 14 def content @content end |
#id ⇒ Integer
Returns the id of the species.
8 9 10 |
# File 'lib/eol/search.rb', line 8 def id @id end |
#link ⇒ String
Returns link to article on the EOL homepage.
12 13 14 |
# File 'lib/eol/search.rb', line 12 def link @link end |
#title ⇒ String
Returns title of the entry.
10 11 12 |
# File 'lib/eol/search.rb', line 10 def title @title end |
Instance Method Details
#each {|@id| ... } ⇒ Object
23 24 25 26 27 28 |
# File 'lib/eol/search.rb', line 23 def each yield @id yield @title yield @link yield @content end |