Class: Kindai::Searcher
- Inherits:
-
Object
- Object
- Kindai::Searcher
- Includes:
- Enumerable
- Defined in:
- lib/kindai/searcher.rb
Instance Attribute Summary collapse
-
#keyword ⇒ Object
Returns the value of attribute keyword.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#keyword ⇒ Object
Returns the value of attribute keyword.
5 6 7 |
# File 'lib/kindai/searcher.rb', line 5 def keyword @keyword end |
Class Method Details
Instance Method Details
#each ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/kindai/searcher.rb', line 17 def each (1..(1/0.0)).each{ |page| Kindai::Util.logger.debug "page #{page}" uris = result_for(@keyword, page) return if uris.empty? uris.each{ |uri| yield Kindai::Book.new_from_permalink(uri) } } end |
#length ⇒ Object
13 14 15 |
# File 'lib/kindai/searcher.rb', line 13 def length @length ||= total_of(@keyword) end |