Class: Fathom::NetworkPopulation

Inherits:
Object
  • Object
show all
Extended by:
Plugins
Defined in:
lib/fathom/contexts/network_population.rb

Instance Method Summary collapse

Methods included from Plugins

plugin, plugins

Instance Method Details

#import_records_from_yaml(opts = {}) ⇒ Object

Uses YAML to populate a network.

Expects a format in the YAML that mirrors the data models we are using.

Dependencies:

  • yaml (standard library)

  • open-uri (standard library)

Roles: NetworkBuilder

Usage: @context.import_records_from_yaml(:filename => ‘some_network.yml’)



22
23
24
25
26
27
28
# File 'lib/fathom/contexts/network_population.rb', line 22

def import_records_from_yaml(opts={})
  require 'yaml'
  require 'open-uri'
  object.extend NetworkBuilder
  hash = extract_data_hash_from_parameters(opts)
  object.from_hash(hash)
end