Class: SitemapGenerator::WaveAdapter
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- SitemapGenerator::WaveAdapter
- Defined in:
- lib/sitemap_generator/adapters/wave_adapter.rb
Overview
Class for uploading sitemaps to a remote server using the CarrierWave gem.
Instance Attribute Summary collapse
-
#store_dir ⇒ Object
Returns the value of attribute store_dir.
Instance Method Summary collapse
-
#write(location, raw_data) ⇒ Object
Call with a SitemapLocation and string data.
Instance Attribute Details
#store_dir ⇒ Object
Returns the value of attribute store_dir.
11 12 13 |
# File 'lib/sitemap_generator/adapters/wave_adapter.rb', line 11 def store_dir @store_dir end |
Instance Method Details
#write(location, raw_data) ⇒ Object
Call with a SitemapLocation and string data
14 15 16 17 18 19 20 21 |
# File 'lib/sitemap_generator/adapters/wave_adapter.rb', line 14 def write(location, raw_data) SitemapGenerator::FileAdapter.new.write(location, raw_data) directory = File.dirname(location.path_in_public) if directory != '.' self.store_dir = directory end store!(open(location.path, 'rb')) end |