module SwaggerCodegenRails::Konstants
Public Instance Methods
base_path(type)
click to toggle source
# File lib/swagger_codegen_rails/konstants.rb, line 16 def base_path(type) case type when :controller concern_dir when :model schema_dir else raise ArgumentError end rescue ArgumentError => e puts "ArgumentError (not in [:controller, :model])" end
find_from_path(source, match)
click to toggle source
# File lib/swagger_codegen_rails/konstants.rb, line 12 def find_from_path(source, match) Dir.glob(File.join(source, match)) end
include_swagger(dir, type: :controller)
click to toggle source
# File lib/swagger_codegen_rails/konstants.rb, line 6 def include_swagger(dir, type: :controller) find_from_path(dir, "/**/*.rb").each do |path| include Konstant.new(path, base_path(type)).specify! end end