Class: Liquidizer::FileSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/liquidizer/file_system.rb

Overview

File system for liquid that loads the templates from the database

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ FileSystem

Returns a new instance of FileSystem.



4
5
6
# File 'lib/liquidizer/file_system.rb', line 4

def initialize(&block)
  @source = block
end

Instance Method Details

#read_template_file(template_path) ⇒ Object



8
9
10
11
# File 'lib/liquidizer/file_system.rb', line 8

def read_template_file(template_path)
  record = @source.call.find_by_name(template_path)
  record && record.content
end