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.



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