Module: Ace::Retro::Atoms::RetroFrontmatterDefaults

Defined in:
lib/ace/retro/atoms/retro_frontmatter_defaults.rb

Overview

Provides default frontmatter values for retro files. Generates the canonical YAML frontmatter block for new retros.

Class Method Summary collapse

Class Method Details

.build(id:, title:, type: "standard", tags: [], status: "active", created_at: Time.now.utc) ⇒ Hash

Build frontmatter hash for a new retro

Parameters:

  • id (String)

    Raw 6-char b36ts ID

  • title (String)

    Retro title

  • type (String) (defaults to: "standard")

    Retro type (standard, conversation-analysis, self-review)

  • tags (Array<String>) (defaults to: [])

    List of tags (default: [])

  • status (String) (defaults to: "active")

    Initial status (default: “active”)

  • created_at (Time) (defaults to: Time.now.utc)

    Creation time (default: now)

Returns:

  • (Hash)

    Frontmatter hash ready for YAML serialization



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ace/retro/atoms/retro_frontmatter_defaults.rb', line 19

def self.build(id:, title:, type: "standard", tags: [], status: "active",
  created_at: Time.now.utc)
  {
    "id" => id,
    "title" => title,
    "type" => type,
    "tags" => Array(tags),
    "created_at" => created_at.strftime("%Y-%m-%d %H:%M:%S"),
    "status" => status
  }
end

.serialize(frontmatter) ⇒ String

Serialize frontmatter hash to YAML block string. Delegates to the shared FrontmatterSerializer atom.

Parameters:

  • frontmatter (Hash)

    Frontmatter data

Returns:

  • (String)

    YAML frontmatter block including delimiters



35
36
37
38
# File 'lib/ace/retro/atoms/retro_frontmatter_defaults.rb', line 35

def self.serialize(frontmatter)
  require "ace/support/items"
  Ace::Support::Items::Atoms::FrontmatterSerializer.serialize(frontmatter)
end