Class: OpenLibraryAuthor
- Inherits:
-
OpenLibraryEntry
- Object
- OpenLibraryEntry
- OpenLibraryAuthor
- Defined in:
- lib/fetchworks.rb
Overview
A class that represents authors in the OpenLibrary database
Instance Attribute Summary
Attributes inherited from OpenLibraryEntry
Instance Method Summary collapse
- #birth_date ⇒ Object
- #death_date ⇒ Object
-
#initialize(url) ⇒ OpenLibraryAuthor
constructor
Can only access authors at present via the URL provided for them in book data.
Methods included from HashMethodable
#method_missing, #respond_to_missing?
Constructor Details
#initialize(url) ⇒ OpenLibraryAuthor
Can only access authors at present via the URL provided for them in book data
158 159 160 |
# File 'lib/fetchworks.rb', line 158 def initialize(url) super OpenLibrary.(url) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class HashMethodable
Instance Method Details
#birth_date ⇒ Object
162 163 164 165 |
# File 'lib/fetchworks.rb', line 162 def birth_date str = @data["birth_date"] OpenLibrary.partial_date_from_str(str) end |
#death_date ⇒ Object
167 168 169 170 |
# File 'lib/fetchworks.rb', line 167 def death_date str = @data["death_date"] OpenLibrary.partial_date_from_str(str) end |