class ContentfulMiddleman::LocalData::File

Public Class Methods

new(data, path) click to toggle source
# File lib/contentful_middleman/local_data/file.rb, line 14
def initialize(data, path)
  @data = data
  @path = path
end
thor() click to toggle source
# File lib/contentful_middleman/local_data/file.rb, line 9
def thor
  @thor
end
thor=(thor) click to toggle source
# File lib/contentful_middleman/local_data/file.rb, line 5
def thor=(thor)
  @thor = thor
end

Public Instance Methods

local_data_file_path() click to toggle source
# File lib/contentful_middleman/local_data/file.rb, line 23
def local_data_file_path
  base_path = LocalData::Store.base_path
  ::File.join(base_path, @path + ".yaml")
end
write() click to toggle source
# File lib/contentful_middleman/local_data/file.rb, line 19
def write
  self.class.thor.create_file(local_data_file_path, nil, {}) { @data }
end