Class: Scrapbot::Storage
- Inherits:
-
Object
- Object
- Scrapbot::Storage
- Defined in:
- lib/scrapbot/storage.rb
Instance Attribute Summary collapse
-
#magazine ⇒ Object
Returns the value of attribute magazine.
Instance Method Summary collapse
-
#initialize ⇒ Storage
constructor
A new instance of Storage.
- #save_all ⇒ Object
Constructor Details
#initialize ⇒ Storage
Returns a new instance of Storage.
9 10 11 12 |
# File 'lib/scrapbot/storage.rb', line 9 def initialize self.magazine = [] end |
Instance Attribute Details
#magazine ⇒ Object
Returns the value of attribute magazine.
7 8 9 |
# File 'lib/scrapbot/storage.rb', line 7 def magazine @magazine end |
Instance Method Details
#save_all ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/scrapbot/storage.rb', line 14 def save_all self.magazine.each do |response| File.open(save_path(response),'wb') do |f| f.write(response.body) end end end |