Class: Cadmus::PartialFileSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/cadmus/partial_file_system.rb

Overview

An implementation of Liquid's FileSystem interface that lets it read partials from a model that includes Cadmus::Partial

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ PartialFileSystem

Returns a new instance of PartialFileSystem.



4
5
6
# File 'lib/cadmus/partial_file_system.rb', line 4

def initialize(parent)
  @parent = parent
end

Instance Method Details

#read_template_file(template_path) ⇒ Object



8
9
10
# File 'lib/cadmus/partial_file_system.rb', line 8

def read_template_file(template_path)
  partial_scope.find_by!(partial_model.name_field => template_path).content
end