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    
getfitter / lib / get_fitter / configuration.rb
Size: Mime:
module GetFitter
  # Provides the configuration for the instance.
  class Configuration
    # The URL endpoint to use.
    attr_accessor :url

    attr_accessor :token

    # Create a new configuration instance.
    #
    # This also allows providing a hash of configuration values, which calls
    # the accessor methods to full in the values.
    def initialize(opts = {})
      opts.each do |k, v|
        send("#{k}=".to_sym, v)
      end
    end

    # Hash representation of the configuration object.
    def to_h
      {
        url: @url,
        token: @token
      }
    end

    # String representation of the configuration, with secrets hidden.
    def to_s
      "#<#{self.class.name}:#{object_id}>"
    end
  end
end