Class: Redcarpet::Render::SeeingIsBelieving::Enricher

Inherits:
Object
  • Object
show all
Defined in:
lib/redcarpet/render/seeing_is_believing/enricher.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = Options.new) ⇒ Enricher

Returns a new instance of Enricher.



8
9
10
# File 'lib/redcarpet/render/seeing_is_believing/enricher.rb', line 8

def initialize(options = Options.new)
  @options = options
end

Instance Method Details

#process(code) ⇒ Object



12
13
14
15
16
17
# File 'lib/redcarpet/render/seeing_is_believing/enricher.rb', line 12

def process(code)
  code.split("\n").
    zip(evaluate_code(code)).
    map(&combine_code_with_result).
    join("\n")
end