Class: Gumdrop::Data::YAMLDBDataProvider

Inherits:
YAMLandJSONDataProvider show all
Defined in:
lib/gumdrop/data_providers/yamldb.rb

Instance Method Summary collapse

Methods inherited from YAMLandJSONDataProvider

#available?

Methods inherited from Provider

#available?, extensions, for, registered_exts, #supply_data

Instance Method Details

#data_for(filepath) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/gumdrop/data_providers/yamldb.rb', line 7

def data_for(filepath)
  docs=[]
  File.open(filepath, 'r') do |f|
    YAML.load_documents(f) do |doc|
      docs << supply_data( doc ) #unless doc.has_key?("__proto__")
    end
  end
  docs
end