class Head::Description

Public Class Methods

new(config:, frontmatter:) click to toggle source
# File lib/nexmo_developer/app/presenters/head.rb, line 3
def initialize(config:, frontmatter:)
  @config      = config
  @frontmatter = frontmatter
end

Public Instance Methods

description() click to toggle source
# File lib/nexmo_developer/app/presenters/head.rb, line 8
def description
  @description ||= from_frontmatter || @config.fetch('description') do
    raise "You must provide a 'description' parameter in header_meta.yml"
  end
end
from_frontmatter() click to toggle source
# File lib/nexmo_developer/app/presenters/head.rb, line 14
def from_frontmatter
  @frontmatter && (@frontmatter['meta_description'] || @frontmatter['description'])
end