Class: Flexi::Json::Loader
- Inherits:
-
Object
- Object
- Flexi::Json::Loader
- Defined in:
- lib/flexi/json/loader.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ Loader
constructor
A new instance of Loader.
- #load_data ⇒ Object
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_data ⇒ Object
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 |