Class: Support::Generator
- Inherits:
-
Object
- Object
- Support::Generator
- Defined in:
- lib/support/generator.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(options) ⇒ Generator
constructor
A new instance of Generator.
- #process(files, locals = {}) ⇒ Object
Constructor Details
#initialize(options) ⇒ Generator
Returns a new instance of Generator.
9 10 11 12 |
# File 'lib/support/generator.rb', line 9 def initialize() @destination = .fetch(:destination) @source = .fetch(:source) end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
7 8 9 |
# File 'lib/support/generator.rb', line 7 def destination @destination end |
#source ⇒ Object (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 |