Class: Pocketbook::BookRenderer::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/pocketbook/book_renderer/metadata.rb

Constant Summary collapse

DEFAULT_VALUES =
{
  title: "Untitled Book",
  subtitle: "",
  author: "Unknown Author",
  publisher: "Pocketbook",
  backcover_text: "",
  size: "6in 9in"
}.freeze
METADATA_KEYS =
%i[title subtitle author publisher backcover_text size].freeze

Instance Method Summary collapse

Instance Method Details

#resolve(theme_defaults:, cli_metadata:, front_matter:, first_input_path:) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/pocketbook/book_renderer/metadata.rb', line 15

def resolve(theme_defaults:, cli_metadata:, front_matter:, first_input_path:)
   = DEFAULT_VALUES
    .merge(theme_defaults)
    .merge()

  [:size] = normalize_size([:size])
  apply_front_matter!(, front_matter, )
  apply_input_fallbacks!(, first_input_path)

  
end