Class: Slideck::Transformer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/slideck/transformer.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 transforming file content into metadata and slides

Instance Method Summary collapse

Constructor Details

#initialize(loader, parser, metadata_wrapper) ⇒ Transformer

Create a Transformer instance

Examples:

Transformer.new(loader, parser, )

Parameters:



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

def initialize(loader, parser, )
  @loader = loader
  @parser = parser
  @metadata_wrapper = 
end

Instance Method Details

#read(filename) ⇒ Array<Slideck::Metadata, Array<Hash>>

Read metadata and slides from a file

Examples:

transformer.read("slides.md")

Parameters:

  • filename (String)

    the filename to read metadata and slides from

Returns:



38
39
40
# File 'lib/slideck/transformer.rb', line 38

def read(filename)
  @metadata_wrapper.wrap(@parser.parse(@loader.load(filename)))
end