Sha256: d9069e6cb51f4fd57af36cb00715b0922a3b7ce9df862ce6e66f7ce57c966b91

Contents?: true

Size: 883 Bytes

Versions: 22

Compression:

Stored size: 883 Bytes

Contents

module Plutonium
  module Core
    module Autodiscovery
      module InputDiscoverer
        extend ActiveSupport::Concern
        include Discoverer

        class_methods do
          def autodiscovery_input_cache = @autodiscovery_input_cache ||= {}
        end

        private

        # If cache_discovery is enabled, use the class level cache that persists
        # between requests, otherwise use the instance one.
        def autodiscovery_input_cache
          if Rails.application.config.plutonium.cache_discovery
            self.class.autodiscovery_input_cache
          else
            @autodiscovery_input_cache ||= {}
          end
        end

        def autodiscover_input(name)
          autodiscovery_input_cache[name] ||=
            Plutonium::Core::Fields::Inputs::Factory.for_resource_attribute(resource_class, name)
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
plutonium-0.14.0 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.13.3 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.13.2 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.13.1 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.13.0 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.14 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.13 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.12 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.11 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.10 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.9 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.8 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.7 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.5 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.4 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.3 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.2 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.1 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.12.0 lib/plutonium/core/autodiscovery/input_discoverer.rb
plutonium-0.11.2 lib/plutonium/core/autodiscovery/input_discoverer.rb