Module: DynamicContent
- Defined in:
- lib/dynamic_content.rb,
lib/dynamic_content/error.rb,
lib/dynamic_content/engine.rb,
lib/dynamic_content/version.rb,
lib/dynamic_content/processor.rb,
app/models/dynamic_content/page.rb,
app/models/dynamic_content/content.rb,
app/models/dynamic_content/section.rb,
lib/dynamic_content/tag_serializer.rb,
lib/generators/dynamic_content/install/install_generator.rb
Defined Under Namespace
Modules: Generators
Classes: Content, DependencyError, Engine, Error, ErrorLoading, GeneratorError, InvalidStructureError, NoDataLoadedError, NoStructureFileError, Page, Processor, Section, TagSerializer
Constant Summary
collapse
- VERSION =
"1.0.1"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.locale ⇒ Object
17
18
19
|
# File 'lib/dynamic_content.rb', line 17
def locale
@locale
end
|
.structure_path ⇒ Object
14
15
16
|
# File 'lib/dynamic_content.rb', line 14
def structure_path
@structure_path
end
|
Class Method Details
.process ⇒ Object
40
41
42
|
# File 'lib/dynamic_content.rb', line 40
def self.process
Processor.new
end
|
.settings ⇒ Object
44
45
46
47
48
49
|
# File 'lib/dynamic_content.rb', line 44
def self.settings
{
locale: self.locale,
structure_path: self.structure_path
}
end
|
.setup {|_self| ... } ⇒ Object
36
37
38
|
# File 'lib/dynamic_content.rb', line 36
def self.setup(&block)
yield self
end
|
.structure_file ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/dynamic_content.rb', line 28
def self.structure_file
if File.exists? Rails.root.join(self.structure_path)
return YAML.load(File.read(Rails.root.join(self.structure_path)))
else
raise NoStructureFileError, "File #{self.structure_path} is not found."
end
end
|