Class: Slideck::Parser Private
- Inherits:
-
Object
- Object
- Slideck::Parser
- Defined in:
- lib/slideck/parser.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 extracting metadata and slides from content
Instance Method Summary collapse
-
#initialize(string_scanner, metadata_parser) ⇒ Parser
constructor
Create a Parser instance.
-
#parse(content) ⇒ Hash{Symbol => Hash, Array<String>}
Parse metadata and slides from content.
Constructor Details
#initialize(string_scanner, metadata_parser) ⇒ Parser
Create a Parser instance
43 44 45 46 |
# File 'lib/slideck/parser.rb', line 43 def initialize(string_scanner, ) @string_scanner = string_scanner @metadata_parser = end |
Instance Method Details
#parse(content) ⇒ Hash{Symbol => Hash, Array<String>}
Parse metadata and slides from content
60 61 62 63 64 65 66 |
# File 'lib/slideck/parser.rb', line 60 def parse(content) scanner = @string_scanner.new(content) = (scanner) = (.first && .first[:content]) {metadata: , slides: .empty? ? : [1..-1]} end |