Class: TildeScraper::Page
- Inherits:
-
Object
- Object
- TildeScraper::Page
- Extended by:
- Memorable::ClassMethods
- Includes:
- Memorable::InstanceMethods
- Defined in:
- lib/tilde_scraper/page.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#group ⇒ Object
Returns the value of attribute group.
-
#next_link ⇒ Object
Returns the value of attribute next_link.
-
#order ⇒ Object
Returns the value of attribute order.
-
#page_id ⇒ Object
Returns the value of attribute page_id.
-
#period ⇒ Object
Returns the value of attribute period.
-
#prev_link ⇒ Object
Returns the value of attribute prev_link.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #display ⇒ Object
-
#initialize(attributes) ⇒ Page
constructor
A new instance of Page.
- #topics ⇒ Object
Methods included from Memorable::ClassMethods
Methods included from Memorable::InstanceMethods
Constructor Details
#initialize(attributes) ⇒ Page
Returns a new instance of Page.
13 14 15 16 |
# File 'lib/tilde_scraper/page.rb', line 13 def initialize(attributes) super(attributes) get_query end |
Instance Attribute Details
#group ⇒ Object
Returns the value of attribute group.
2 3 4 |
# File 'lib/tilde_scraper/page.rb', line 2 def group @group end |
#next_link ⇒ Object
Returns the value of attribute next_link.
2 3 4 |
# File 'lib/tilde_scraper/page.rb', line 2 def next_link @next_link end |
#order ⇒ Object
Returns the value of attribute order.
2 3 4 |
# File 'lib/tilde_scraper/page.rb', line 2 def order @order end |
#page_id ⇒ Object
Returns the value of attribute page_id.
2 3 4 |
# File 'lib/tilde_scraper/page.rb', line 2 def page_id @page_id end |
#period ⇒ Object
Returns the value of attribute period.
2 3 4 |
# File 'lib/tilde_scraper/page.rb', line 2 def period @period end |
#prev_link ⇒ Object
Returns the value of attribute prev_link.
2 3 4 |
# File 'lib/tilde_scraper/page.rb', line 2 def prev_link @prev_link end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/tilde_scraper/page.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
9 10 11 |
# File 'lib/tilde_scraper/page.rb', line 9 def self.all @@all end |
Instance Method Details
#display ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/tilde_scraper/page.rb', line 22 def display topics.each.with_index(1) do |topic, index| puts "#{index}. #{topic.type}post" topic.display puts "" end end |
#topics ⇒ Object
18 19 20 |
# File 'lib/tilde_scraper/page.rb', line 18 def topics TildeScraper::Topic.find_by_page_id(page_id) end |