Repository URL to install this package:
|
Version:
4.0 ▾
|
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