Class: OpenLibraryEntry
- Inherits:
-
Object
- Object
- OpenLibraryEntry
- Includes:
- HashMethodable
- Defined in:
- lib/fetchworks.rb
Overview
Methods common to OpenLibraryBook’s and OpenLibraryAuthor’s Exposes the JSON representation of an OL entry as a hash through @data, and as methods with method_missing,
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ OpenLibraryEntry
constructor
A new instance of OpenLibraryEntry.
Methods included from HashMethodable
#method_missing, #respond_to_missing?
Constructor Details
#initialize(data) ⇒ OpenLibraryEntry
Returns a new instance of OpenLibraryEntry.
147 148 149 150 151 |
# File 'lib/fetchworks.rb', line 147 def initialize(data) raise StandardError unless data.is_a? Hash @data = data end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class HashMethodable
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
145 146 147 |
# File 'lib/fetchworks.rb', line 145 def data @data end |