Class: Scrapbot::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/scrapbot/storage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStorage

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

#magazineObject

Returns the value of attribute magazine.



7
8
9
# File 'lib/scrapbot/storage.rb', line 7

def magazine
  @magazine
end

Instance Method Details

#save_allObject



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