Sha256: ab20104ac1c1d7708aea63afaa1ae32bf52463dca0723fdf0e64305143d4a916

Contents?: true

Size: 730 Bytes

Versions: 2

Compression:

Stored size: 730 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}"

require_relative "schemaless_rest_api/rest_server"

module SchemalessRestApi
  class Error < StandardError; end
  # Your code goes here...
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
schemaless_rest_api-0.1.1 lib/schemaless_rest_api.rb
schemaless_rest_api-0.1.0 lib/schemaless_rest_api.rb