Sha256: d1319d70d79805ecfdda08a575095f0267ec336369201a7621274ed3c68b9720
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
# frozen_string_literal: true require "mountapi/version" require "mountapi/rack_app" if defined?(Rails) require "mountapi/config" require "mountapi/router" require "mountapi/open_api" require "mountapi/handler/behaviour" require "mountapi/handler/registry" require "mountapi/error" require "mountapi/request" require "mountapi/adapters/user_info_adapter" require "mountapi/railtie" if defined?(Rails::Railtie) module Mountapi class << self attr_writer :config end # @return [Mountapi::Config] mountapi config def self.config @config ||= Config.new end # @yield [Mountapi::Config] def self.configure yield(config) end # @return [Mountapi::Router] the router instance def self.router @router ||= Router.new.tap do |router| config.open_api_spec.each do |document| OpenApi.document(document).routes.each do |route| router.add(route) end end end end def self.handlers @handlers ||= Handler::Registry.new end # Reset config and router # May be usefull for test purposes def self.reset @router = nil @config = nil end def self.logger config.logger end def self.url_for(*args) router.url_for(*args) end # @param [Mountapi::Request] # @return [Mountapi::Response] def self.call(*args) Mountapi::Request.call(*args) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mountapi-0.11.1 | lib/mountapi.rb |