Class: Mammoth::Status
- Inherits:
-
Object
- Object
- Mammoth::Status
- Defined in:
- lib/mammoth/status.rb
Overview
Builds and prints a boring operational status snapshot.
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#sqlite_store ⇒ Object
readonly
Returns the value of attribute sqlite_store.
Class Method Summary collapse
-
.call(config, sqlite_store: nil) ⇒ void
Print status for a configuration and optional SQLite store.
Instance Method Summary collapse
-
#call ⇒ void
Print the status snapshot.
-
#initialize(config, sqlite_store: nil) ⇒ Status
constructor
A new instance of Status.
Constructor Details
#initialize(config, sqlite_store: nil) ⇒ Status
Returns a new instance of Status.
19 20 21 22 |
# File 'lib/mammoth/status.rb', line 19 def initialize(config, sqlite_store: nil) @config = config @sqlite_store = sqlite_store end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/mammoth/status.rb', line 6 def config @config end |
#sqlite_store ⇒ Object (readonly)
Returns the value of attribute sqlite_store.
6 7 8 |
# File 'lib/mammoth/status.rb', line 6 def sqlite_store @sqlite_store end |
Class Method Details
.call(config, sqlite_store: nil) ⇒ void
This method returns an undefined value.
Print status for a configuration and optional SQLite store.
13 14 15 |
# File 'lib/mammoth/status.rb', line 13 def self.call(config, sqlite_store: nil) new(config, sqlite_store: sqlite_store).call end |
Instance Method Details
#call ⇒ void
This method returns an undefined value.
Print the status snapshot.
27 28 29 30 31 32 33 |
# File 'lib/mammoth/status.rb', line 27 def call puts "Mammoth: #{config.dig("mammoth", "name")}" puts "Runtime: not started" puts "SQLite: #{sqlite_path}" puts "Webhook: #{config.dig("webhook", "name")}" print_store_state if sqlite_store end |