Class: RhetButler::SlideRenderers::Code

Inherits:
RhetButler::SlideRenderer show all
Defined in:
lib/rhet-butler/slide-renderers/code.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RhetButler::SlideRenderer

#configure, #normalize_config, required_config, #setup_defaults

Methods inherited from YamlType

#check_config_hash, #init_with, #initialize, register, #setup_defaults, #value_from_config

Constructor Details

This class inherits a constructor from RhetButler::YamlType

Class Method Details

.optional_configObject



6
7
8
# File 'lib/rhet-butler/slide-renderers/code.rb', line 6

def self.optional_config
  %w{class}
end

Instance Method Details

#html_classObject



14
15
16
# File 'lib/rhet-butler/slide-renderers/code.rb', line 14

def html_class
  "code"
end

#positional_optionsObject



10
11
12
# File 'lib/rhet-butler/slide-renderers/code.rb', line 10

def positional_options
  %w{class}
end

#process(string) ⇒ Object



18
19
20
# File 'lib/rhet-butler/slide-renderers/code.rb', line 18

def process(string)
  "<pre><code#{@config_hash ? " class='#{@config_hash['class']}'" : ""}>#{string}</code></pre>"
end