Class: ContentfulMiddleman::LocalData::File
- Inherits:
-
Object
- Object
- ContentfulMiddleman::LocalData::File
- Defined in:
- lib/contentful_middleman/local_data/file.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data, path) ⇒ File
constructor
A new instance of File.
- #local_data_file_path ⇒ Object
- #write ⇒ Object
Constructor Details
#initialize(data, path) ⇒ File
Returns a new instance of File.
14 15 16 17 |
# File 'lib/contentful_middleman/local_data/file.rb', line 14 def initialize(data, path) @data = data @path = path end |
Class Method Details
.thor ⇒ Object
9 10 11 |
# File 'lib/contentful_middleman/local_data/file.rb', line 9 def thor @thor end |
.thor=(thor) ⇒ Object
5 6 7 |
# File 'lib/contentful_middleman/local_data/file.rb', line 5 def thor=(thor) @thor = thor end |
Instance Method Details
#local_data_file_path ⇒ Object
23 24 25 26 |
# 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 ⇒ Object
19 20 21 |
# File 'lib/contentful_middleman/local_data/file.rb', line 19 def write self.class.thor.create_file(local_data_file_path, nil, {}) { @data } end |