Class: Alexandrite::Google
- Inherits:
-
Object
- Object
- Alexandrite::Google
- Extended by:
- GoogleAPI
- Defined in:
- lib/alexandrite.rb
Overview
Get and Process data from Google API
Constant Summary
Constants included from GoogleAPI
Alexandrite::GoogleAPI::BASE_URL, Alexandrite::GoogleAPI::FIELDS, Alexandrite::GoogleAPI::FILTERS
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Attributes included from GoogleAPI
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key, query) ⇒ Google
constructor
A new instance of Google.
Methods included from GoogleAPI
Methods included from Helpers::Validation
#define_isbn_type, #valid_isbn_length?, #validate_isbn
Methods included from Helpers::Format
#add_fields, #remove_non_digits
Constructor Details
#initialize(key, query) ⇒ Google
Returns a new instance of Google.
18 19 20 |
# File 'lib/alexandrite.rb', line 18 def initialize(key, query) @result = search_by(key, query) end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
16 17 18 |
# File 'lib/alexandrite.rb', line 16 def result @result end |
Class Method Details
.create_book(isbn) ⇒ Alexandrite::Book
23 24 25 26 |
# File 'lib/alexandrite.rb', line 23 def self.create_book(isbn) volume_info = get_volume_info(isbn) Alexandrite::Book.new(volume_info) end |