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



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

def evaluate(_scope, _locals, &_block)
  @output ||= JSX.transform(data, options)
end

#prepareObject



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

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