module Gems::Settings::Declaration
The macros that declare the settings, extended into whatever includes {Settings} @api private
Public Instance Methods
Declare a setting that is a number of times
@api private @param name [Symbol] the name of the setting @return [Symbol] the name of the writer @example Declare a maximum
count_setting :max_retries
# File lib/gems/settings.rb, line 44 def count_setting(name) attr_reader(name) define_method(:"#{name}=") do |count| # @type self: Settings instance_variable_set(:"@#{name}", validate_count(name, count)) end end
Declare a setting that is a number of seconds
@api private @param name [Symbol] the name of the setting @return [Symbol] the name of the writer @example Declare a timeout
seconds_setting :open_timeout
# File lib/gems/settings.rb, line 28 def seconds_setting(name) attr_reader(name) define_method(:"#{name}=") do |seconds| # @type self: Settings instance_variable_set(:"@#{name}", validate_number(name, seconds)) end end