Class: Google::Books::Item

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item) ⇒ Item

Returns a new instance of Item.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/bookle/google_books_item.rb', line 12

def initialize(item)
	item 					= {} unless item
	@kind 				= item["kind"]
	@id 					= item["id"]
	@etag					= item["etag"]
	@self_link 		= item["selfLink"]
	@volume_info 	= Google::Books::VolumeInfo.new(item["volumeInfo"])
	@sale_info 		= Google::Books::SaleInfo.new(item["saleInfo"])
	@access_info 	= Google::Books::AccessInfo.new(item["accessInfo"])
	@search_info 	= Google::Books::SearchInfo.new(item["searchInfo"])
end

Instance Attribute Details

#access_infoObject (readonly)

Returns the value of attribute access_info.



10
11
12
# File 'lib/bookle/google_books_item.rb', line 10

def access_info
  @access_info
end

#etagObject (readonly)

Returns the value of attribute etag.



10
11
12
# File 'lib/bookle/google_books_item.rb', line 10

def etag
  @etag
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/bookle/google_books_item.rb', line 10

def id
  @id
end

#kindObject (readonly)

Returns the value of attribute kind.



10
11
12
# File 'lib/bookle/google_books_item.rb', line 10

def kind
  @kind
end

#sale_infoObject (readonly)

Returns the value of attribute sale_info.



10
11
12
# File 'lib/bookle/google_books_item.rb', line 10

def sale_info
  @sale_info
end

#search_infoObject (readonly)

Returns the value of attribute search_info.



10
11
12
# File 'lib/bookle/google_books_item.rb', line 10

def search_info
  @search_info
end

Returns the value of attribute self_link.



10
11
12
# File 'lib/bookle/google_books_item.rb', line 10

def self_link
  @self_link
end

#volume_infoObject (readonly)

Returns the value of attribute volume_info.



10
11
12
# File 'lib/bookle/google_books_item.rb', line 10

def volume_info
  @volume_info
end

Instance Method Details

#hashObject



24
25
26
# File 'lib/bookle/google_books_item.rb', line 24

def hash
	Hasherizer.to_hash(self)
end