Class: HackerCurse::ForumPage

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/hacker/curse/abstractsiteparser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#articlesObject

array of article objects



23
24
25
# File 'lib/hacker/curse/abstractsiteparser.rb', line 23

def articles
  @articles
end

#create_dateObject

Returns the value of attribute create_date.



20
21
22
# File 'lib/hacker/curse/abstractsiteparser.rb', line 20

def create_date
  @create_date
end

#next_urlObject

Returns the value of attribute next_url.



19
20
21
# File 'lib/hacker/curse/abstractsiteparser.rb', line 19

def next_url
  @next_url
end

#subforumObject

Returns the value of attribute subforum.



21
22
23
# File 'lib/hacker/curse/abstractsiteparser.rb', line 21

def subforum
  @subforum
end

#urlObject

new newest hot rising etc



18
19
20
# File 'lib/hacker/curse/abstractsiteparser.rb', line 18

def url
  @url
end

Instance Method Details

#eachObject Also known as: each_article



24
25
26
# File 'lib/hacker/curse/abstractsiteparser.rb', line 24

def each
  @articles.each do |e| yield(e) ; end
end

#merge_page(page) ⇒ Object



28
29
30
31
32
# File 'lib/hacker/curse/abstractsiteparser.rb', line 28

def merge_page page
  self.next_url = page.next_url
  self.articles.push(*page.articles)
  self
end