Sha256: 2a6bca3e9ceb52a7fdf39040f9f27175f712a92a439f3a53381c2c31ad12cf31
Contents?: true
Size: 744 Bytes
Versions: 5
Compression:
Stored size: 744 Bytes
Contents
# frozen_string_literal: true # author: Vadim Shaveiko <@vshaveyko> # :nodoc: module RailsApiDoc::Controller::Repo attr_accessor :repo def self.extended(base) base.instance_eval do @repo = Hash.new do |hsh, key| hsh[key] = Hash.new do |hsh, key| hsh[key] = RailsApiDoc::Controller::Request::Param.new(key, {}) end end end end def method_missing(name, *args, &block) return @repo.send(name, *args, &block) if respond_to_missing?(name) super 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
Version data entries
5 entries across 5 versions & 1 rubygems