Class: Audioproxy::Config
- Inherits:
-
Object
- Object
- Audioproxy::Config
- Defined in:
- lib/audioproxy/config.rb
Overview
Process-global settings for URL generation. Assign through
Audioproxy.configure; every attribute validates at assignment so a typo
fails at boot rather than in a mailer.
Constant Summary collapse
- HEX =
/\A(?:\h\h)+\z/- EXPIRY_KEYS =
Option keys defaults may carry: the proxy's typed short keys and their spelled-out aliases, plus the pre-rendered
raw:escape hatch. An unrecognized key is a typo, and a typo that is silently dropped emits a valid URL for the wrong variant.exp is subtracted deliberately (D1). It is an absolute instant, so a default would expire every URL the process ever mints at one second, and it would skip the validation the keywords run.
expires_inbelow is the default that makes sense. (Options::REQUEST_KEYS + Options::REQUEST_KEYS.filter_map { |key| Options::ALIASES[key] }) .uniq.freeze
- OPTION_KEYS =
(([ :raw ] + Options::KEYS + Options::ALIASES.values).uniq - EXPIRY_KEYS).freeze
Instance Attribute Summary collapse
-
#default_options ⇒ Object
Returns the value of attribute default_options.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#expires_in ⇒ Object
Returns the value of attribute expires_in.
-
#key ⇒ Object
Returns the value of attribute key.
-
#salt ⇒ Object
Returns the value of attribute salt.
-
#unsigned ⇒ Object
Returns the value of attribute unsigned.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
34 35 36 37 38 39 40 41 |
# File 'lib/audioproxy/config.rb', line 34 def initialize @endpoint = nil @key = nil @salt = nil @unsigned = false @default_options = {} @expires_in = nil end |
Instance Attribute Details
#default_options ⇒ Object
Returns the value of attribute default_options.
31 32 33 |
# File 'lib/audioproxy/config.rb', line 31 def @default_options end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
31 32 33 |
# File 'lib/audioproxy/config.rb', line 31 def endpoint @endpoint end |
#expires_in ⇒ Object
Returns the value of attribute expires_in.
31 32 33 |
# File 'lib/audioproxy/config.rb', line 31 def expires_in @expires_in end |
#key ⇒ Object
Returns the value of attribute key.
31 32 33 |
# File 'lib/audioproxy/config.rb', line 31 def key @key end |
#salt ⇒ Object
Returns the value of attribute salt.
31 32 33 |
# File 'lib/audioproxy/config.rb', line 31 def salt @salt end |
#unsigned ⇒ Object
Returns the value of attribute unsigned.
32 33 34 |
# File 'lib/audioproxy/config.rb', line 32 def unsigned @unsigned end |