class ActiveYaml::Base
Public Class Methods
extension()
click to toggle source
# File lib/active_yaml/base.rb, line 20 def extension "yml" end
load_file()
click to toggle source
# File lib/active_yaml/base.rb, line 12 def load_file if (data = raw_data).is_a?(Array) data elsif data.respond_to?(:values) data.map{ |key, value| {"key" => key}.merge(value) } end end
Private Class Methods
load_path(path)
click to toggle source
# File lib/active_yaml/base.rb, line 26 def load_path(path) result = File.read(path) result = ERB.new(result).result if process_erb YAML.unsafe_load(result) end