Class: ContentfulMiddleman::LocalData::Store

Inherits:
Object
  • Object
show all
Includes:
Tools::Backup::InstanceMethods
Defined in:
lib/contentful_middleman/local_data/store.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Tools::Backup::InstanceMethods

#do_with_backup

Constructor Details

#initialize(files, folder) ⇒ Store

Returns a new instance of Store.



16
17
18
19
# File 'lib/contentful_middleman/local_data/store.rb', line 16

def initialize(files, folder)
  @files  = files
  @folder = folder
end

Class Method Details

.base_pathObject



11
12
13
# File 'lib/contentful_middleman/local_data/store.rb', line 11

def base_path
  @base_path
end

.base_path=(path) ⇒ Object



7
8
9
# File 'lib/contentful_middleman/local_data/store.rb', line 7

def base_path=(path)
  @base_path = path
end

Instance Method Details

#writeObject



21
22
23
24
25
# File 'lib/contentful_middleman/local_data/store.rb', line 21

def write
  do_with_backup backup_name, path_to_backup do
    @files.each(&:write)
  end
end