Method: KDoc::YamlDoc#load
- Defined in:
- lib/k_doc/yaml_doc.rb
#load(load_action: :once, data_action: :replace) ⇒ Object
Load data from file
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/k_doc/yaml_doc.rb', line 31 def load(load_action: :once, data_action: :replace) return if load_action == :once && loaded? content = File.read(file) hash = YAML.safe_load(content) set_data(hash, data_action: data_action) @loaded = true end |