Class: AutoprefixerRails::Compiler
- Inherits:
-
Object
- Object
- AutoprefixerRails::Compiler
- Defined in:
- lib/autoprefixer-rails/compiler.rb
Overview
Ruby to JS wrapper for Autoprefixer compiler instance
Instance Method Summary collapse
-
#compile(css) ⇒ Object
Return prefixed ‘css`.
-
#compiler ⇒ Object
Lazy load for JS instance.
-
#initialize(browsers = nil) ⇒ Compiler
constructor
A new instance of Compiler.
-
#inspect ⇒ Object
Return, which browsers and prefixes will be used.
Constructor Details
#initialize(browsers = nil) ⇒ Compiler
Returns a new instance of Compiler.
24 25 26 |
# File 'lib/autoprefixer-rails/compiler.rb', line 24 def initialize(browsers=nil) @browsers = browsers || [] end |
Instance Method Details
#compile(css) ⇒ Object
Return prefixed ‘css`
29 30 31 |
# File 'lib/autoprefixer-rails/compiler.rb', line 29 def compile(css) compiler.call('compile', css) end |
#compiler ⇒ Object
Lazy load for JS instance
39 40 41 |
# File 'lib/autoprefixer-rails/compiler.rb', line 39 def compiler @compiler ||= ExecJS.compile(build_js) end |
#inspect ⇒ Object
Return, which browsers and prefixes will be used
34 35 36 |
# File 'lib/autoprefixer-rails/compiler.rb', line 34 def inspect compiler.call('inspect') end |