Class: Biran::ERBConfig
- Inherits:
-
Object
- Object
- Biran::ERBConfig
- Defined in:
- lib/biran/erb_config.rb
Instance Attribute Summary collapse
-
#bindings ⇒ Object
Returns the value of attribute bindings.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#extension ⇒ Object
readonly
Returns the value of attribute extension.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
-
#source_dir ⇒ Object
readonly
Returns the value of attribute source_dir.
Instance Method Summary collapse
-
#initialize(config, name, extension, source, output) ⇒ ERBConfig
constructor
A new instance of ERBConfig.
- #save! ⇒ Object
Constructor Details
#initialize(config, name, extension, source, output) ⇒ ERBConfig
Returns a new instance of ERBConfig.
6 7 8 9 10 11 12 |
# File 'lib/biran/erb_config.rb', line 6 def initialize(config, name, extension, source, output) @name = name @extension = extension @config = config @source_dir = source @output_dir = output end |
Instance Attribute Details
#bindings ⇒ Object
Returns the value of attribute bindings.
4 5 6 |
# File 'lib/biran/erb_config.rb', line 4 def bindings @bindings end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/biran/erb_config.rb', line 3 def config @config end |
#extension ⇒ Object (readonly)
Returns the value of attribute extension.
3 4 5 |
# File 'lib/biran/erb_config.rb', line 3 def extension @extension end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/biran/erb_config.rb', line 3 def name @name end |
#output_dir ⇒ Object (readonly)
Returns the value of attribute output_dir.
3 4 5 |
# File 'lib/biran/erb_config.rb', line 3 def output_dir @output_dir end |
#source_dir ⇒ Object (readonly)
Returns the value of attribute source_dir.
3 4 5 |
# File 'lib/biran/erb_config.rb', line 3 def source_dir @source_dir end |
Instance Method Details
#save! ⇒ Object
14 15 16 17 18 |
# File 'lib/biran/erb_config.rb', line 14 def save! File.open(File.join(output_dir, "#{name}#{extension}"), 'w') do |f| f.print process_erb.result(build_erb_env.call) end end |