Class: ERBLint::FileLoader
- Inherits:
-
Object
- Object
- ERBLint::FileLoader
- Defined in:
- lib/erb_lint/file_loader.rb
Overview
Loads file from disk
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
Instance Method Summary collapse
-
#initialize(base_path) ⇒ FileLoader
constructor
A new instance of FileLoader.
- #yaml(filename) ⇒ Object
Constructor Details
#initialize(base_path) ⇒ FileLoader
Returns a new instance of FileLoader.
8 9 10 |
# File 'lib/erb_lint/file_loader.rb', line 8 def initialize(base_path) @base_path = base_path end |
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
6 7 8 |
# File 'lib/erb_lint/file_loader.rb', line 6 def base_path @base_path end |
Instance Method Details
#yaml(filename) ⇒ Object
13 14 15 |
# File 'lib/erb_lint/file_loader.rb', line 13 def yaml(filename) YAML.safe_load(read_content(filename), permitted_classes: [Regexp, Symbol], filename: filename) || {} end |