Class: Minarai::Loaders::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/minarai/loaders/base.rb

Direct Known Subclasses

RecipeLoader, VariableLoader

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Base

Returns a new instance of Base.



8
9
10
# File 'lib/minarai/loaders/base.rb', line 8

def initialize(path)
  @path = path
end

Instance Method Details

#loadObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/minarai/loaders/base.rb', line 12

def load
  case
  when !existed_file?
    raise "Does not exist file: #{pathname}"
  when yml_file?
    load_yaml_file
  when erb_file?
    load_erb_file
  else
    raise 'inalid extname error'
  end
end