Sha256: c7c3891a248397fe71d3d0ce7f1529c35efd5b8aaa855836eb950975df8a8e33
Contents?: true
Size: 720 Bytes
Versions: 21
Compression:
Stored size: 720 Bytes
Contents
# frozen_string_literal: true module NeetoCommonsBackend module Routes class << self def draw(routes_name) load_draw(routes_name) end def neeto_routes(routes_name) Rails.root.join("config/routes/#{routes_name}.rb") end def commons_routes(routes_name) "#{File.dirname(__FILE__)}/#{routes_name}.rb" end def load_draw(routes_name) if File.exist?(neeto_routes(routes_name)) Rails.application.routes.draw do instance_eval(File.read(NeetoCommonsBackend::Routes.neeto_routes(routes_name))) end else instance_eval(File.read(commons_routes(routes_name))) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems
Version | Path |
---|---|
neeto-commons-backend-1.0.89 | lib/neeto_commons_backend/routes/draw.rb |