Class: Pic2ch::Thread
- Inherits:
-
Struct
- Object
- Struct
- Pic2ch::Thread
- Defined in:
- lib/pic2ch/thread.rb,
lib/pic2ch/thread.rb,
lib/pic2ch/thread/static.rb,
lib/pic2ch/thread/element_parser.rb
Direct Known Subclasses
Defined Under Namespace
Modules: ElementParser Classes: Static
Instance Attribute Summary collapse
-
#created ⇒ Object
Returns the value of attribute created.
-
#link ⇒ Object
Returns the value of attribute link.
-
#name ⇒ Object
Returns the value of attribute name.
-
#star ⇒ Object
Returns the value of attribute star.
Instance Method Summary collapse
- #code ⇒ Object
- #download ⇒ Object
-
#downloader ⇒ Object
Downloader.
-
#parser ⇒ Object
Parser.
-
#url ⇒ Object
Accessors.
Instance Attribute Details
#created ⇒ Object
Returns the value of attribute created
5 6 7 |
# File 'lib/pic2ch/thread.rb', line 5 def created @created end |
#link ⇒ Object
Returns the value of attribute link
5 6 7 |
# File 'lib/pic2ch/thread.rb', line 5 def link @link end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/pic2ch/thread.rb', line 5 def name @name end |
#star ⇒ Object
Returns the value of attribute star
5 6 7 |
# File 'lib/pic2ch/thread.rb', line 5 def star @star end |
Instance Method Details
#code ⇒ Object
14 15 16 |
# File 'lib/pic2ch/thread.rb', line 14 def code link.to_s.scan(/\d+/).flatten.first.to_i end |
#download ⇒ Object
34 35 36 37 38 |
# File 'lib/pic2ch/thread.rb', line 34 def download Dir.chdir(Pic2ch.root) do downloader.execute end end |
#downloader ⇒ Object
Downloader
30 31 32 |
# File 'lib/pic2ch/thread.rb', line 30 def downloader Downloaders::Thread.new(self) end |
#parser ⇒ Object
Parser
21 22 23 |
# File 'lib/pic2ch/thread.rb', line 21 def parser @parser ||= Parsers::Thread.new(self) end |
#url ⇒ Object
Accessors
10 11 12 |
# File 'lib/pic2ch/thread.rb', line 10 def url Pic2ch.url + link end |