Class: Partyhat::Forums::ForumThread
- Inherits:
-
Object
- Object
- Partyhat::Forums::ForumThread
- Defined in:
- lib/partyhat/forums/forum_thread.rb
Overview
TODO: Add pagination support
e.g. thread.next_page
Constant Summary collapse
- URL_FORMAT =
'http://services.runescape.com/m=forum/forums.ws?%s'
Instance Method Summary collapse
-
#initialize(qfc) ⇒ ForumThread
constructor
A new instance of ForumThread.
- #link ⇒ Object
- #posts ⇒ Object
- #qfc ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(qfc) ⇒ ForumThread
Returns a new instance of ForumThread.
11 12 13 14 15 16 17 |
# File 'lib/partyhat/forums/forum_thread.rb', line 11 def initialize qfc raise InvalidArgumentError('Invalid quick find code') unless Forums.valid_qfc?(qfc) @posts = [] @qfc = qfc @link = URL_FORMAT % qfc.gsub(/-/, ",") parse_from_page Partyhat::Util.fetch_remote(@link) end |
Instance Method Details
#link ⇒ Object
27 28 29 |
# File 'lib/partyhat/forums/forum_thread.rb', line 27 def link @link end |
#posts ⇒ Object
23 24 25 |
# File 'lib/partyhat/forums/forum_thread.rb', line 23 def posts @posts end |
#qfc ⇒ Object
31 32 33 |
# File 'lib/partyhat/forums/forum_thread.rb', line 31 def qfc @qfc end |
#title ⇒ Object
19 20 21 |
# File 'lib/partyhat/forums/forum_thread.rb', line 19 def title @title end |