Sha256: a6d594f7ee2553c97bc96f57edeff65fde1182dd41924153d5ec66381aa77e40
Contents?: true
Size: 868 Bytes
Versions: 3
Compression:
Stored size: 868 Bytes
Contents
# frozen_string_literal: true require_relative "schemaless_rest_api/version" require_relative "schemaless_rest_api/entities" require "json" require "securerandom" def extract_models error_msg = "Make 'models' environment variable an array (e.g ['model1', 'model2'])" raise "Please set 'models' ENV variable. #{error_msg}" if ENV["models"].nil? models = eval(ENV["models"]) raise error_msg unless models.is_a? Array models end extract_models.each do |model| Entities.models[model.to_sym] = {} end puts "Modelling #{Entities.models.keys}" if ENV['mongodb'] require_relative 'schemaless_rest_api/mongo_client' else puts "[INFO] Using in memory storage. Pass in 'mongodb' ENV variable to store in db" end require_relative "schemaless_rest_api/rest_server" module SchemalessRestApi class Error < StandardError; end # Your code goes here... end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
schemaless_rest_api-0.2.2 | lib/schemaless_rest_api.rb |
schemaless_rest_api-0.2.1 | lib/schemaless_rest_api.rb |
schemaless_rest_api-0.2.0 | lib/schemaless_rest_api.rb |