Class: MarkdownRecord::Rendering::Nodes::JsonFile
- Defined in:
- lib/markdown_record/rendering/nodes/json_file.rb
Constant Summary
Constants included from ContentDsl
ContentDsl::HTML_COMMENT_REGEX
Constants included from ContentDsl::Enable
ContentDsl::Enable::ENCODED_REGEX, ContentDsl::Enable::REGEX
Constants included from ContentDsl::Disable
ContentDsl::Disable::ENCODED_REGEX, ContentDsl::Disable::REGEX
Constants included from ContentDsl::UseLayout
ContentDsl::UseLayout::ENCODED_REGEX, ContentDsl::UseLayout::REGEX
Constants included from ContentDsl::Fragment
ContentDsl::Fragment::ENCODED_REGEX, ContentDsl::Fragment::REGEX
Constants included from ContentDsl::DirectoryFragment
ContentDsl::DirectoryFragment::ENCODED_REGEX, ContentDsl::DirectoryFragment::REGEX
Constants included from ContentDsl::EndModel
ContentDsl::EndModel::ENCODED_REGEX, ContentDsl::EndModel::REGEX
Constants included from ContentDsl::EndAttribute
ContentDsl::EndAttribute::ENCODED_REGEX, ContentDsl::EndAttribute::REGEX
Constants included from ContentDsl::Attribute
ContentDsl::Attribute::ENCODED_REGEX, ContentDsl::Attribute::REGEX
Constants included from ContentDsl::Model
ContentDsl::Model::ENCODED_REGEX, ContentDsl::Model::REGEX
Constants included from ContentDsl::Scope
ContentDsl::Scope::ENCODED_REGEX, ContentDsl::Scope::REGEX
Instance Attribute Summary
Attributes inherited from JsonBase
#concatenated, #json_models, #name
Instance Method Summary collapse
- #directory_meta ⇒ Object
- #directory_scope ⇒ Object
- #fragment_meta ⇒ Object
-
#initialize ⇒ JsonFile
constructor
A new instance of JsonFile.
- #render(file_saver, inherited_scope = nil) ⇒ Object
- #scope ⇒ Object
Methods inherited from JsonBase
Methods included from ContentDsl
#remove_html_dsl_command, #remove_json_dsl_commands
Methods included from ContentDsl::Enable
Methods included from ContentDsl::Disable
Methods included from ContentDsl::UseLayout
Methods included from ContentDsl::Fragment
Methods included from ContentDsl::DirectoryFragment
#directory_fragment_dsl, remove_dsl
Methods included from ContentDsl::EndModel
Methods included from ContentDsl::EndAttribute
#end_attribute_dsl, remove_dsl
Methods included from ContentDsl::Attribute
Methods included from ContentDsl::Model
Methods included from ContentDsl::Scope
Methods included from PathUtilities
#base_content_root_name, #base_rendered_path, #base_rendered_root, #clean_path, #erb_locals_from_path, #fragment_attributes_from_path, #full_path_to_parts, #path_to_fragment_id, #remove_prefix, #rendered_path, #scoped_id_to_parts, #to_scoped_id
Constructor Details
#initialize ⇒ JsonFile
Returns a new instance of JsonFile.
6 7 8 9 |
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 6 def initialize(...) super(...) @concatenated = false end |
Instance Method Details
#directory_meta ⇒ Object
31 32 33 34 |
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 31 def ||= directory_fragment_dsl(raw_content) ||= {} end |
#directory_scope ⇒ Object
27 28 29 |
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 27 def directory_scope @directory_scope ||= scope end |
#fragment_meta ⇒ Object
18 19 20 21 |
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 18 def ||= fragment_dsl(raw_content) ||= {} end |
#render(file_saver, inherited_scope = nil) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 11 def render(file_saver, inherited_scope = nil) @scope ||= inherited_scope render_json apply_scope save(file_saver) if [:deep] end |
#scope ⇒ Object
23 24 25 |
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 23 def scope @scope ||= scope_dsl(raw_content) end |