Sha256: e29b079e743a85d331bcce5c58c3107039ebc914a3f931e39aa340a65f977e76
Contents?: true
Size: 698 Bytes
Versions: 13
Compression:
Stored size: 698 Bytes
Contents
# frozen_string_literal: true # author: Vadim Shaveiko <@vshaveyko> # :nodoc: class RailsApiDoc::Controller::Parameter::Repository @repo = Hash.new { |hsh, key| hsh[key] = Hash.new { |hsh, key| hsh[key] = Param.new(key) } } class << self def method_missing(name, *args, &block) return @repo.send(name, *args, &block) if respond_to_missing?(name) super end def registered_controllers @repo.keys end def respond_to_missing?(method, *) @repo.respond_to?(method) end def []=(key, value) unless key < ActionController::Base raise ArgumentError, 'Repository keys are controllers only' end super end end end
Version data entries
13 entries across 13 versions & 1 rubygems