Module: Brief::Document::FrontMatter
- Extended by:
- ActiveSupport::Concern
- Included in:
- Brief::Document
- Defined in:
- lib/brief/document/front_matter.rb
Instance Method Summary collapse
- #data=(attributes) ⇒ Object
- #frontmatter ⇒ Object
- #frontmatter=(attributes) ⇒ Object
- #frontmatter_line_count ⇒ Object
Instance Method Details
permalink #data=(attributes) ⇒ Object
[View source]
10 11 12 |
# File 'lib/brief/document/front_matter.rb', line 10 def data= attributes self.frontmatter= attributes end |
permalink #frontmatter ⇒ Object
[View source]
14 15 16 17 18 |
# File 'lib/brief/document/front_matter.rb', line 14 def frontmatter (@frontmatter || load_frontmatter).tap do |d| d[:type] ||= parent_folder_name && parent_folder_name.to_s.singularize if parent_folder_name && parent_folder_name.length > 0 end end |
permalink #frontmatter=(attributes) ⇒ Object
[View source]
6 7 8 |
# File 'lib/brief/document/front_matter.rb', line 6 def frontmatter= attributes @frontmatter = attributes end |
permalink #frontmatter_line_count ⇒ Object
[View source]
20 21 22 |
# File 'lib/brief/document/front_matter.rb', line 20 def frontmatter_line_count (@raw_frontmatter && @raw_frontmatter.lines.count) || 0 end |