Class: Hashie::Extensions::Parsers::YamlErbParser
- Inherits:
-
Object
- Object
- Hashie::Extensions::Parsers::YamlErbParser
- Defined in:
- lib/hashie/extensions/parsers/yaml_erb_parser.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file_path) ⇒ YamlErbParser
constructor
A new instance of YamlErbParser.
- #perform ⇒ Object
Constructor Details
#initialize(file_path) ⇒ YamlErbParser
Returns a new instance of YamlErbParser.
7 8 9 10 |
# File 'lib/hashie/extensions/parsers/yaml_erb_parser.rb', line 7 def initialize(file_path) @content = File.read(file_path) @file_path = file_path end |
Class Method Details
.perform(file_path) ⇒ Object
18 19 20 |
# File 'lib/hashie/extensions/parsers/yaml_erb_parser.rb', line 18 def self.perform(file_path) new(file_path).perform end |
Instance Method Details
#perform ⇒ Object
12 13 14 15 16 |
# File 'lib/hashie/extensions/parsers/yaml_erb_parser.rb', line 12 def perform template = ERB.new(@content) template.filename = @file_path YAML.load template.result end |