Class: Google::Books::VolumeInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/bookle/google_books_volume_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(volume_info) ⇒ VolumeInfo

Returns a new instance of VolumeInfo.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/bookle/google_books_volume_info.rb', line 11

def initialize(volume_info)
	volume_info 						= {} unless volume_info
	@title 									= volume_info["title"]
	@subtitle 							= volume_info["subtitle"]
	@authors  							= volume_info["authors"]
	@publisher 							= volume_info["publisher"]
	@published_date 				= volume_info["published_date"]
	@description 						= volume_info["description"]
	@industry_identifiers 	= volume_info["industryIdentifiers"].collect do
															|i| Google::Books::IndustryIdentifier.new(i)
														end if volume_info["industryIdentifiers"]
	@page_count 						= volume_info["pageCount"]
	@print_type 						= volume_info["printType"]
	@categories 						= volume_info["categories"]
	@average_rating 				= volume_info["averageRating"]
	@ratings_count 					= volume_info["ratingsCount"]
	@content_version 				= volume_info["contentVersion"]
	@image_links 						= Google::Books::ImageLinks.new(volume_info["imageLinks"])
	@language 							= volume_info["language"]
	@preview_link 					= volume_info["previewLink"]
	@info_link 							= volume_info["infoLink"]
	@canonical_volume_link 	= volume_info["canonicalVolumeLink"]
end

Instance Attribute Details

#authorsObject (readonly)

Returns the value of attribute authors.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def authors
  @authors
end

#average_ratingObject (readonly)

Returns the value of attribute average_rating.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def average_rating
  @average_rating
end

Returns the value of attribute canonical_volume_link.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def canonical_volume_link
  @canonical_volume_link
end

#categoriesObject (readonly)

Returns the value of attribute categories.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def categories
  @categories
end

#content_versionObject (readonly)

Returns the value of attribute content_version.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def content_version
  @content_version
end

#descriptionObject (readonly)

Returns the value of attribute description.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def description
  @description
end

Returns the value of attribute image_links.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def image_links
  @image_links
end

#industry_identifiersObject (readonly)

Returns the value of attribute industry_identifiers.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def industry_identifiers
  @industry_identifiers
end

Returns the value of attribute info_link.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def info_link
  @info_link
end

#languageObject (readonly)

Returns the value of attribute language.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def language
  @language
end

#page_countObject (readonly)

Returns the value of attribute page_count.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def page_count
  @page_count
end

Returns the value of attribute preview_link.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def preview_link
  @preview_link
end

Returns the value of attribute print_type.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def print_type
  @print_type
end

#published_dateObject (readonly)

Returns the value of attribute published_date.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def published_date
  @published_date
end

#publisherObject (readonly)

Returns the value of attribute publisher.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def publisher
  @publisher
end

#ratings_countObject (readonly)

Returns the value of attribute ratings_count.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def ratings_count
  @ratings_count
end

#subtitleObject (readonly)

Returns the value of attribute subtitle.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def subtitle
  @subtitle
end

#titleObject (readonly)

Returns the value of attribute title.



7
8
9
# File 'lib/bookle/google_books_volume_info.rb', line 7

def title
  @title
end