Class: Slideck::MetadataDefaults Private

Inherits:
Object
  • Object
show all
Defined in:
lib/slideck/metadata_defaults.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.

Default metadata configuration

Instance Method Summary collapse

Constructor Details

#initialize(alignment, margin) ⇒ MetadataDefaults

Create a MetadataDefaults instance

Parameters:



19
20
21
22
23
# File 'lib/slideck/metadata_defaults.rb', line 19

def initialize(alignment, margin)
  @alignment = alignment
  @margin = margin
  @defaults = create_defaults
end

Instance Method Details

#merge(custom_metadata) ⇒ Hash{Symbol => Object}

Merge given custom metadata with defaults

Examples:

.merge({align: "center"})

Parameters:

  • custom_metadata (Hash{Symbol => Object})

    the custom metadata to merge

Returns:

  • (Hash{Symbol => Object})


36
37
38
39
40
# File 'lib/slideck/metadata_defaults.rb', line 36

def merge()
  @defaults.merge() do |_, def_val, val|
    def_val.is_a?(::Hash) ? def_val.merge(val) : val
  end
end