Class: Ace::Support::Items::Models::LoadedDocument

Inherits:
Struct
  • Object
show all
Defined in:
lib/ace/support/items/models/loaded_document.rb

Overview

Value object representing a loaded document with parsed frontmatter, body content, title, and file metadata.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attachmentsObject

Returns the value of attribute attachments

Returns:

  • (Object)

    the current value of attachments



9
10
11
# File 'lib/ace/support/items/models/loaded_document.rb', line 9

def attachments
  @attachments
end

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



9
10
11
# File 'lib/ace/support/items/models/loaded_document.rb', line 9

def body
  @body
end

#dir_pathObject

Returns the value of attribute dir_path

Returns:

  • (Object)

    the current value of dir_path



9
10
11
# File 'lib/ace/support/items/models/loaded_document.rb', line 9

def dir_path
  @dir_path
end

#file_pathObject

Returns the value of attribute file_path

Returns:

  • (Object)

    the current value of file_path



9
10
11
# File 'lib/ace/support/items/models/loaded_document.rb', line 9

def file_path
  @file_path
end

#frontmatterObject

Returns the value of attribute frontmatter

Returns:

  • (Object)

    the current value of frontmatter



9
10
11
# File 'lib/ace/support/items/models/loaded_document.rb', line 9

def frontmatter
  @frontmatter
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



9
10
11
# File 'lib/ace/support/items/models/loaded_document.rb', line 9

def title
  @title
end

Instance Method Details

#[](key) ⇒ Object?

Access frontmatter values by key (string or symbol)

Parameters:

  • key (String, Symbol)

    Frontmatter key

Returns:

  • (Object, nil)

    Value or nil



21
22
23
# File 'lib/ace/support/items/models/loaded_document.rb', line 21

def [](key)
  frontmatter[key.to_s] || frontmatter[key.to_sym]
end