Class: MarkdownRecord::Rendering::Nodes::JsonFile

Inherits:
JsonBase
  • Object
show all
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

Methods inherited from JsonBase

#add_content_fragment, #save

Methods included from ContentDsl

#remove_html_dsl_command, #remove_json_dsl_commands

Methods included from ContentDsl::Enable

#enable_dsl, remove_dsl

Methods included from ContentDsl::Disable

#disable_dsl, remove_dsl

Methods included from ContentDsl::UseLayout

remove_dsl, #use_layout_dsl

Methods included from ContentDsl::Fragment

#fragment_dsl, remove_dsl

Methods included from ContentDsl::DirectoryFragment

#directory_fragment_dsl, remove_dsl

Methods included from ContentDsl::EndModel

#end_model_dsl, remove_dsl

Methods included from ContentDsl::EndAttribute

#end_attribute_dsl, remove_dsl

Methods included from ContentDsl::Attribute

#attribute_dsl, remove_dsl

Methods included from ContentDsl::Model

#model_dsl, remove_dsl

Methods included from ContentDsl::Scope

remove_dsl, #scope_dsl

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

#initializeJsonFile

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_metaObject



31
32
33
34
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 31

def directory_meta
  @directory_meta ||= directory_fragment_dsl(raw_content)
  @directory_meta ||= {}
end

#directory_scopeObject



27
28
29
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 27

def directory_scope
  @directory_scope ||= scope
end

#fragment_metaObject



18
19
20
21
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 18

def fragment_meta
  @fragment_meta ||= fragment_dsl(raw_content)
  @fragment_meta ||= {}
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 @options[:deep]
end

#scopeObject



23
24
25
# File 'lib/markdown_record/rendering/nodes/json_file.rb', line 23

def scope
  @scope ||= scope_dsl(raw_content)
end