Class: Audioproxy::Config

Inherits:
Object
  • Object
show all
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/
OPTION_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.

([ :raw ] + Options::KEYS + Options::ALIASES.values).uniq.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



26
27
28
29
30
31
32
# File 'lib/audioproxy/config.rb', line 26

def initialize
  @endpoint = nil
  @key = nil
  @salt = nil
  @unsigned = false
  @default_options = {}
end

Instance Attribute Details

#default_optionsObject

Returns the value of attribute default_options.



23
24
25
# File 'lib/audioproxy/config.rb', line 23

def default_options
  @default_options
end

#endpointObject

Returns the value of attribute endpoint.



23
24
25
# File 'lib/audioproxy/config.rb', line 23

def endpoint
  @endpoint
end

#keyObject

Returns the value of attribute key.



23
24
25
# File 'lib/audioproxy/config.rb', line 23

def key
  @key
end

#saltObject

Returns the value of attribute salt.



23
24
25
# File 'lib/audioproxy/config.rb', line 23

def salt
  @salt
end

#unsignedObject

Returns the value of attribute unsigned.



24
25
26
# File 'lib/audioproxy/config.rb', line 24

def unsigned
  @unsigned
end