Module: Ace::Idea::Atoms::IdeaFrontmatterDefaults
- Defined in:
- lib/ace/idea/atoms/idea_frontmatter_defaults.rb
Overview
Provides default frontmatter values for idea spec files. Generates the canonical YAML frontmatter block for new ideas.
Class Method Summary collapse
-
.build(id:, title:, tags: [], status: "pending", created_at: Time.now.utc) ⇒ Hash
Build frontmatter hash for a new idea.
-
.serialize(frontmatter) ⇒ String
Serialize frontmatter hash to YAML block string.
Class Method Details
.build(id:, title:, tags: [], status: "pending", created_at: Time.now.utc) ⇒ Hash
Build frontmatter hash for a new idea
18 19 20 21 22 23 24 25 26 |
# File 'lib/ace/idea/atoms/idea_frontmatter_defaults.rb', line 18 def self.build(id:, title:, tags: [], status: "pending", created_at: Time.now.utc) { "id" => id, "status" => status, "title" => title, "tags" => Array(), "created_at" => created_at.strftime("%Y-%m-%d %H:%M:%S") } end |
.serialize(frontmatter) ⇒ String
Serialize frontmatter hash to YAML block string. Delegates to the shared FrontmatterSerializer atom.
32 33 34 35 |
# File 'lib/ace/idea/atoms/idea_frontmatter_defaults.rb', line 32 def self.serialize(frontmatter) require "ace/support/items" Ace::Support::Items::Atoms::FrontmatterSerializer.serialize(frontmatter) end |