Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
settings / lib / settings / data_source / build.rb
Size: Mime:
class Settings
  class DataSource
    module Build
      def self.call(input=nil)
        logger = Telemetry::Logger.get self
        logger.opt_trace "Building (Input Type: #{input.class.name})"

        data_source_type = type(input)

        data_source_type.build(input).tap do |instance|
          logger.opt_debug "Built (#{instance})"
        end
      end
      class << self; alias :! :call; end # TODO: Remove deprecated actuator [Kelsey, Thu Oct 08 2015]

      def self.type(input=nil)
        return Settings::DataSource::Hash if input.is_a?(::Hash)
        return Settings::DataSource::File if input.is_a?(String) || input.nil?

        raise Settings::Error, "Input is not supported: #{input}"
      end
    end
  end
end