Class: Middleman::React::Template

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/middleman-react/jsx/template.rb

Overview

Tilt Tempalte for handling JSX files

Instance Method Summary collapse

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



25
26
27
# File 'lib/middleman-react/jsx/template.rb', line 25

def evaluate(scope, locals, &block)
  @output ||= JSX.transform(data, options)
end

#prepareObject



16
17
18
19
20
21
22
23
# File 'lib/middleman-react/jsx/template.rb', line 16

def prepare
  if self.class.harmony || options.key?(:harmony)
    options[:harmony] = self.class.harmony
  end
  if self.class.strip_types || options.key?(:stripTypes)
    options[:stripTypes] = self.class.strip_types
  end
end