module Burstfm
Constants
- VERSION
Public Class Methods
front_matter(options = {})
click to toggle source
# File lib/burstfm.rb, line 6 def front_matter(options = {}) return [ {label: "layout", content: "post"}, {label: "status", content: "publish"}, {label: "published", content: "true"}, {label: "title", content: options[:title] || "This is a title"}, {label: "date", content: Time.now.to_s}, {label: "categories", content: "\n- Category"}, {label: "tags", content: "\n- first_tag\n- second_tag"} ] end
print(options = {})
click to toggle source
# File lib/burstfm.rb, line 22 def print(options = {}) front_matter(options).each do |line| print_line(line) end end
print_line(line)
click to toggle source
# File lib/burstfm.rb, line 18 def print_line(line) puts("#{line[:label].yellow}: #{line[:content].cyan}") end