Class: Slideck::MetadataWrapper Private

Inherits:
Object
  • Object
show all
Defined in:
lib/slideck/metadata_wrapper.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Responsible for wrapping parsed global and slide metadata

Instance Method Summary collapse

Constructor Details

#initialize(metadata, metadata_converter, metadata_defaults) ⇒ MetadataWrapper

Create a MetadataWrapper instance

Examples:

MetadataWrapper.new(, , )

Parameters:



21
22
23
24
25
# File 'lib/slideck/metadata_wrapper.rb', line 21

def initialize(, , )
  @metadata = 
  @metadata_converter = 
  @metadata_defaults = 
end

Instance Method Details

#wrap(deck) ⇒ Array<Slideck::Metadata, Hash>

Wrap parsed global and slide metadata

Examples:

.wrap({metadata: {}, slides: []})

Parameters:

  • deck (Hash{Symbol => Hash, String})

    the deck of parsed metadata and slides

Returns:



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/slideck/metadata_wrapper.rb', line 38

def wrap(deck)
  [
    (deck[:metadata], @metadata_defaults),
    deck[:slides].map do |slide|
      {
        content: slide[:content],
        metadata: (slide[:metadata], {})
      }
    end
  ]
end