Class: Stevenson::OutputFilter::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/stevenson/output_filter/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Generator

Returns a new instance of Generator.



6
7
8
# File 'lib/stevenson/output_filter/generator.rb', line 6

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/stevenson/output_filter/generator.rb', line 4

def options
  @options
end

Instance Method Details

#generate!(template) ⇒ Object



10
11
12
13
14
# File 'lib/stevenson/output_filter/generator.rb', line 10

def generate!(template)
  filters.inject(template.local_directory) do |rendered, filter|
    OutputFilter.filter_for(filter).new(rendered, options).output
  end
end