Class: Loader_JSON
Instance Method Summary collapse
Methods inherited from Loader
Constructor Details
This class inherits a constructor from Loader
Instance Method Details
#load(filename) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/Yinspire/Loaders/Loader_JSON.rb', line 6 def load(filename) @entities = Hash.new data = YAML.load(File.read(filename)) case data['format'] when 'yinspire.1' load_v1(data) when 'yinspire.c' load_c(data) else raise "invalid format" end end |