Class: Google::Book::Response
- Inherits:
-
Object
- Object
- Google::Book::Response
- Includes:
- Enumerable
- Defined in:
- lib/google/book/response.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(hash) ⇒ Response
constructor
A new instance of Response.
- #total_results ⇒ Object
Constructor Details
#initialize(hash) ⇒ Response
Returns a new instance of Response.
8 9 10 |
# File 'lib/google/book/response.rb', line 8 def initialize(hash) @feed = hash['feed'] end |
Instance Method Details
#each(&block) ⇒ Object
12 13 14 15 16 |
# File 'lib/google/book/response.rb', line 12 def each(&block) members.each do |member| block.call(Entry.new(member)) end end |
#total_results ⇒ Object
18 19 20 |
# File 'lib/google/book/response.rb', line 18 def total_results @feed['openSearch:totalResults'].to_i end |