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
-
.build(id:, title:, type: "standard", tags: [], status: "active", created_at: Time.now.utc) ⇒ Hash
Build frontmatter hash for a new retro.
-
.serialize(frontmatter) ⇒ String
Serialize frontmatter hash to YAML block string.
Class Method Details
.build(id:, title:, type: "standard", tags: [], status: "active", created_at: Time.now.utc) ⇒ Hash
Build frontmatter hash for a new retro
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(), "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.
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 |