Class: Phi::Losophy::Pages
- Inherits:
-
Object
- Object
- Phi::Losophy::Pages
- Extended by:
- Forwardable
- Includes:
- Enumerable, Logger
- Defined in:
- lib/phi/losophy/pages.rb
Instance Attribute Summary collapse
-
#browsed ⇒ Object
readonly
Returns the value of attribute browsed.
-
#losophy ⇒ Object
readonly
Returns the value of attribute losophy.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
Instance Method Summary collapse
- #current_page ⇒ Object
- #each ⇒ Object
-
#initialize(losophy) ⇒ Pages
constructor
A new instance of Pages.
- #next ⇒ Object
Methods included from Logger
Constructor Details
#initialize(losophy) ⇒ Pages
Returns a new instance of Pages.
10 11 12 13 |
# File 'lib/phi/losophy/pages.rb', line 10 def initialize(losophy) @losophy = losophy @pages = [] end |
Instance Attribute Details
#browsed ⇒ Object (readonly)
Returns the value of attribute browsed.
8 9 10 |
# File 'lib/phi/losophy/pages.rb', line 8 def browsed @browsed end |
#losophy ⇒ Object (readonly)
Returns the value of attribute losophy.
8 9 10 |
# File 'lib/phi/losophy/pages.rb', line 8 def losophy @losophy end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
8 9 10 |
# File 'lib/phi/losophy/pages.rb', line 8 def pages @pages end |
Instance Method Details
#current_page ⇒ Object
19 20 21 |
# File 'lib/phi/losophy/pages.rb', line 19 def current_page @current_page || self.current_page = first_page end |
#each ⇒ Object
15 16 17 |
# File 'lib/phi/losophy/pages.rb', line 15 def each yield self.next until current_page.philosophy? end |
#next ⇒ Object
23 24 25 26 27 |
# File 'lib/phi/losophy/pages.rb', line 23 def next infinite_loop! max_pages! self.current_page = current_page.next end |