Class: Condenser::EjxTransformer

Inherits:
NodeProcessor
  • Object
show all
Defined in:
lib/condenser/transformers/ejx.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ EjxTransformer

Returns a new instance of EjxTransformer.



5
6
7
# File 'lib/condenser/transformers/ejx.rb', line 5

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



3
4
5
# File 'lib/condenser/transformers/ejx.rb', line 3

def options
  @options
end

Class Method Details

.call(environment, input) ⇒ Object



17
18
19
# File 'lib/condenser/transformers/ejx.rb', line 17

def self.call(environment, input)
  new.call(environment, input)
end

.setup(environment) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/condenser/transformers/ejx.rb', line 9

def self.setup(environment)
  require 'ejx' unless defined?(::EJX)

  if !environment.path.include?(EJX::ASSET_DIR)
    environment.append_path(EJX::ASSET_DIR)
  end
end

Instance Method Details

#call(environment, input) ⇒ Object



21
22
23
# File 'lib/condenser/transformers/ejx.rb', line 21

def call(environment, input)
  input[:source] = EJX::Template.new(input[:source], @options).to_module
end