Class: RabbitMQHttpAuthBackend::Config
- Inherits:
-
Object
- Object
- RabbitMQHttpAuthBackend::Config
- Defined in:
- lib/rabbitmq_http_auth_backend/config.rb,
lib/rabbitmq_http_auth_backend/config/runtime.rb
Defined Under Namespace
Classes: Runtime
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
- .configuration ⇒ Object
- .default_configuration ⇒ Object
- .default_configuration_key ⇒ Object
- .reset! ⇒ Object
- .version(version) ⇒ Object
- .versions ⇒ Object
Instance Method Summary collapse
- #fetch(resource, element) ⇒ Object
- #http_method ⇒ Object
-
#initialize(version = DEFAULT_CFG_KEY) ⇒ Config
constructor
A new instance of Config.
- #resource_path ⇒ Object
- #resource_resolver ⇒ Object
- #topic_path ⇒ Object
- #topic_resolver ⇒ Object
- #user_path ⇒ Object
- #user_resolver ⇒ Object
- #vhost_path ⇒ Object
- #vhost_resolver ⇒ Object
Constructor Details
#initialize(version = DEFAULT_CFG_KEY) ⇒ Config
Returns a new instance of Config.
55 56 57 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 55 def initialize(version = DEFAULT_CFG_KEY) @version = version.to_sym end |
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
53 54 55 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 53 def version @version end |
Class Method Details
.configuration ⇒ Object
27 28 29 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 27 def self.configuration @configuration ||= { default_configuration_key => default_configuration } end |
.default_configuration ⇒ Object
43 44 45 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 43 def self.default_configuration {}.merge(DEFAULT_VALUES) end |
.default_configuration_key ⇒ Object
39 40 41 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 39 def self.default_configuration_key DEFAULT_CFG_KEY end |
.reset! ⇒ Object
31 32 33 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 31 def self.reset! @configuration = { default_configuration_key => default_configuration } end |
.version(version) ⇒ Object
47 48 49 50 51 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 47 def self.version(version) return unless versions.include?(version) new(version) end |
.versions ⇒ Object
35 36 37 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 35 def self.versions configuration.keys end |
Instance Method Details
#fetch(resource, element) ⇒ Object
95 96 97 98 99 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 95 def fetch(resource, element) method = "#{resource}_#{element}".to_sym return nil unless respond_to?(method) public_send(method) end |
#http_method ⇒ Object
59 60 61 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 59 def http_method data[:http_method] end |
#resource_path ⇒ Object
79 80 81 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 79 def resource_path sanitize_path(data[:resource_path]) end |
#resource_resolver ⇒ Object
83 84 85 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 83 def resource_resolver data[:resource_resolver] end |
#topic_path ⇒ Object
87 88 89 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 87 def topic_path sanitize_path(data[:topic_path]) end |
#topic_resolver ⇒ Object
91 92 93 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 91 def topic_resolver data[:topic_resolver] end |
#user_path ⇒ Object
63 64 65 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 63 def user_path sanitize_path(data[:user_path]) end |
#user_resolver ⇒ Object
67 68 69 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 67 def user_resolver data[:user_resolver] end |
#vhost_path ⇒ Object
71 72 73 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 71 def vhost_path sanitize_path(data[:vhost_path]) end |
#vhost_resolver ⇒ Object
75 76 77 |
# File 'lib/rabbitmq_http_auth_backend/config.rb', line 75 def vhost_resolver data[:vhost_resolver] end |