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,
lib/dynamic_content/tag_serializer.rb,
lib/generators/dynamic_content/install/install_generator.rb

Defined Under Namespace

Modules: Generators Classes: DependencyError, Engine, Error, ErrorLoading, GeneratorError, InvalidStructureError, NoStructureFileError, Processor, TagSerializer

Constant Summary collapse

VERSION =
"1.0.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.localeObject

Locale



18
19
20
# File 'lib/dynamic_content.rb', line 18

def locale
  @locale
end

.structure_pathObject

Structure file path



15
16
17
# File 'lib/dynamic_content.rb', line 15

def structure_path
  @structure_path
end

Class Method Details

.processObject



41
42
43
# File 'lib/dynamic_content.rb', line 41

def self.process
  Processor.new
end

.settingsObject



45
46
47
48
49
50
# File 'lib/dynamic_content.rb', line 45

def self.settings
  {
    locale: self.locale,
    structure_path: self.structure_path
  }
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



37
38
39
# File 'lib/dynamic_content.rb', line 37

def self.setup(&block)
  yield self
end

.structure_fileObject



29
30
31
32
33
34
35
# File 'lib/dynamic_content.rb', line 29

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