Class: Barnie::Response
- Inherits:
-
Object
- Object
- Barnie::Response
- Includes:
- Helpers, Enumerable
- Defined in:
- lib/barnie/response.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(page) ⇒ Response
constructor
A new instance of Response.
Methods included from Helpers
#extract_authors, #extract_binding, #extract_isbn, #extract_link, #extract_price, #extract_ships_in, #extract_title, #sanitize_string, #title
Constructor Details
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
9 10 11 |
# File 'lib/barnie/response.rb', line 9 def page @page end |
Instance Method Details
#each(&block) ⇒ Object
17 18 19 |
# File 'lib/barnie/response.rb', line 17 def each(&block) page.search('#prod-container').each { |html| block.call(parse(html)) } end |