Class: Fare::ConfigurationWhenLocked
- Inherits:
-
Object
- Object
- Fare::ConfigurationWhenLocked
- Defined in:
- lib/fare/configuration_when_locked.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #app_name ⇒ Object
- #app_version ⇒ Object
- #fetch_subscriber(name) ⇒ Object
- #fetch_subscriber_queue(name) ⇒ Object
- #find_publishable_topic(options) ⇒ Object
-
#initialize(options) ⇒ ConfigurationWhenLocked
constructor
A new instance of ConfigurationWhenLocked.
- #validate_subscriber! ⇒ Object
Constructor Details
#initialize(options) ⇒ ConfigurationWhenLocked
Returns a new instance of ConfigurationWhenLocked.
6 7 8 9 10 11 |
# File 'lib/fare/configuration_when_locked.rb', line 6 def initialize() = validate_lockfile! @configuration = loaded_configuration.load_configuration @configuration.load_environment(environment) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/fare/configuration_when_locked.rb', line 4 def end |
Instance Method Details
#app_name ⇒ Object
24 25 26 |
# File 'lib/fare/configuration_when_locked.rb', line 24 def app_name configuration.app_name end |
#app_version ⇒ Object
28 29 30 |
# File 'lib/fare/configuration_when_locked.rb', line 28 def app_version configuration.app_version || "unknown" end |
#fetch_subscriber(name) ⇒ Object
32 33 34 |
# File 'lib/fare/configuration_when_locked.rb', line 32 def fetch_subscriber(name) configuration.subscribers.fetch(name) end |
#fetch_subscriber_queue(name) ⇒ Object
36 37 38 |
# File 'lib/fare/configuration_when_locked.rb', line 36 def fetch_subscriber_queue(name) Fare.queue_adapter.fetch(environment, name) end |
#find_publishable_topic(options) ⇒ Object
18 19 20 21 22 |
# File 'lib/fare/configuration_when_locked.rb', line 18 def find_publishable_topic() lock_file_contents.fetch("publishes").find { |t| t.fetch("subject") == .fetch(:subject) && t.fetch("action") == .fetch(:action) } end |
#validate_subscriber! ⇒ Object
13 14 15 16 |
# File 'lib/fare/configuration_when_locked.rb', line 13 def validate_subscriber! configuration.setup.call configuration.stacks.each(&:to_app) end |