Class: Fare::GenerateLockFile
- Inherits:
-
Object
- Object
- Fare::GenerateLockFile
- Extended by:
- Forwardable
- Defined in:
- lib/fare/generate_lock_file.rb
Instance Attribute Summary collapse
-
#force ⇒ Object
readonly
Returns the value of attribute force.
-
#queues ⇒ Object
readonly
Returns the value of attribute queues.
-
#topics ⇒ Object
readonly
Returns the value of attribute topics.
Instance Method Summary collapse
- #call ⇒ Object
- #configuration ⇒ Object
-
#initialize(options = {}) ⇒ GenerateLockFile
constructor
A new instance of GenerateLockFile.
Constructor Details
#initialize(options = {}) ⇒ GenerateLockFile
Returns a new instance of GenerateLockFile.
9 10 11 12 13 14 |
# File 'lib/fare/generate_lock_file.rb', line 9 def initialize( = {}) @force = .delete(:force) { false } @configuration = LoadConfigurationFile.new() @topics = {} @queues = {} end |
Instance Attribute Details
#force ⇒ Object (readonly)
Returns the value of attribute force.
7 8 9 |
# File 'lib/fare/generate_lock_file.rb', line 7 def force @force end |
#queues ⇒ Object (readonly)
Returns the value of attribute queues.
7 8 9 |
# File 'lib/fare/generate_lock_file.rb', line 7 def queues @queues end |
#topics ⇒ Object (readonly)
Returns the value of attribute topics.
7 8 9 |
# File 'lib/fare/generate_lock_file.rb', line 7 def topics @topics end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fare/generate_lock_file.rb', line 20 def call return if configuration.load_environment(environment) find_publishing_topics find_subscriber_queues File.open(lock_filename, "w:utf-8") do |f| f.write(data.to_yaml) end end |
#configuration ⇒ Object
16 17 18 |
# File 'lib/fare/generate_lock_file.rb', line 16 def configuration @configuration.configuration end |