Class: CSV2API::Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- CSV2API::Server
- Includes:
- Utils
- Defined in:
- lib/csv2api/server.rb
Overview
Contains the Sinatra-based API Server
Instance Method Summary collapse
-
#load_data(endpoint) ⇒ Array<Hash>
Loads data for response.
Methods included from Utils
csv_files, file_names, generate_json, included, load_csv, sanitize_column_headers
Instance Method Details
#load_data(endpoint) ⇒ Array<Hash>
Loads data for response
58 59 60 61 |
# File 'lib/csv2api/server.rb', line 58 def load_data(endpoint) csv_file = load_csv(settings.csv_path, endpoint) CSV2API::Parser.new(csv_file).all end |