Class: Barnie::Response
- Inherits:
-
Object
- Object
- Barnie::Response
- Includes:
- Helpers
- Defined in:
- lib/barnie/response.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
-
#each ⇒ Object
Yields each snapshot to given block.
-
#initialize(page) ⇒ Response
constructor
A new instance of Response.
-
#to_a ⇒ Object
Returns an array of snapshots.
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.
8 9 10 |
# File 'lib/barnie/response.rb', line 8 def page @page end |
Instance Method Details
#each ⇒ Object
Yields each snapshot to given block.
18 19 20 |
# File 'lib/barnie/response.rb', line 18 def each container.each { |html| yield parse(html) } end |
#to_a ⇒ Object
Returns an array of snapshots.
24 25 26 |
# File 'lib/barnie/response.rb', line 24 def to_a container.map { |html| parse(html) } end |