Class: ERBLint::FileLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/erb_lint/file_loader.rb

Overview

Loads file from disk

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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