Class: Support::Generator

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

Direct Known Subclasses

Rail::Generator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Generator

Returns a new instance of Generator.



9
10
11
12
# File 'lib/support/generator.rb', line 9

def initialize(options)
  @destination = options.fetch(:destination)
  @source = options.fetch(:source)
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



7
8
9
# File 'lib/support/generator.rb', line 7

def destination
  @destination
end

#sourceObject (readonly)

Returns the value of attribute source.



7
8
9
# File 'lib/support/generator.rb', line 7

def source
  @source
end

Instance Method Details

#process(files, locals = {}) ⇒ Object



14
15
16
17
# File 'lib/support/generator.rb', line 14

def process(files, locals = {})
  context = OpenStruct.new(locals)
  files.each { |file| process_one(file, context) }
end