Class: Jekyll::Drivers::YamlDriver
- Inherits:
-
Object
- Object
- Jekyll::Drivers::YamlDriver
- Defined in:
- lib/jekyll/drivers/yaml_driver.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ YamlDriver
constructor
A new instance of YamlDriver.
- #load ⇒ Object
Constructor Details
#initialize(options) ⇒ YamlDriver
Returns a new instance of YamlDriver.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/jekyll/drivers/yaml_driver.rb', line 6 def initialize() @path = ['path'] if !@path raise FatalException.new "'path' must be specified for yaml data source: #{['name']}." end if !File.exists?(@path) raise FatalException.new "the file '#{@path}' doesn't exist for data source '#{['name']}'" end end |
Instance Method Details
#load ⇒ Object
18 19 20 |
# File 'lib/jekyll/drivers/yaml_driver.rb', line 18 def load YAML.safe_load_file(@path) end |