Class: Alexandrite::Google

Inherits:
Object
  • Object
show all
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

Attributes included from GoogleAPI

#isbn

Class Method Summary collapse

Instance Method Summary collapse

Methods included from GoogleAPI

search, search_by

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

#resultObject (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

Returns:



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