Class: SitemapGenerator::WaveAdapter

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#store_dirObject

Returns the value of attribute store_dir.



9
10
11
# File 'lib/sitemap_generator/adapters/wave_adapter.rb', line 9

def store_dir
  @store_dir
end

Instance Method Details

#write(location, raw_data) ⇒ Object

Call with a SitemapLocation and string data



12
13
14
15
16
17
18
19
# File 'lib/sitemap_generator/adapters/wave_adapter.rb', line 12

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