Class: ChambaSearchMx::Pagination
- Inherits:
-
Object
- Object
- ChambaSearchMx::Pagination
- Defined in:
- lib/chamba_search_mx/pagination.rb
Overview
provides the url of the search pagination
Instance Attribute Summary collapse
-
#urls ⇒ Object
readonly
Returns the value of attribute urls.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Pagination
constructor
A new instance of Pagination.
-
#load(url) ⇒ class
Self.
Constructor Details
#initialize(opts = {}) ⇒ Pagination
Returns a new instance of Pagination.
9 10 11 12 |
# File 'lib/chamba_search_mx/pagination.rb', line 9 def initialize(opts = {}) @urls = [] @http = opts[:http] || ChambaSearchMx::HTMLPage.new end |
Instance Attribute Details
#urls ⇒ Object (readonly)
Returns the value of attribute urls.
5 6 7 |
# File 'lib/chamba_search_mx/pagination.rb', line 5 def urls @urls end |
Instance Method Details
#load(url) ⇒ class
17 18 19 20 21 |
# File 'lib/chamba_search_mx/pagination.rb', line 17 def load(url) @http.load url @urls = find_pages.map! { |p| p == '#' ? url : p } self end |