Class: Flexi::Json::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/flexi/json/loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Loader

Returns a new instance of Loader.



7
8
9
# File 'lib/flexi/json/loader.rb', line 7

def initialize(data)
  @data = data
end

Instance Method Details

#load_dataObject



11
12
13
14
# File 'lib/flexi/json/loader.rb', line 11

def load_data
  loaded_data = load_from_local_file || load_from_raw_json || load_from_url || []
  loaded_data.map { |result| Dataset.new(result.transform_keys(&:to_sym)) }
end