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.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#sqlite_store ⇒ Object
readonly
Returns the value of attribute sqlite_store.
Class Method Summary collapse
-
.call(config, sqlite_store: nil, output: $stdout) ⇒ 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, output: $stdout) ⇒ Status
constructor
A new instance of Status.
Constructor Details
#initialize(config, sqlite_store: nil, output: $stdout) ⇒ Status
Returns a new instance of Status.
20 21 22 23 24 |
# File 'lib/mammoth/status.rb', line 20 def initialize(config, sqlite_store: nil, output: $stdout) @config = config @sqlite_store = sqlite_store @output = output 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 |
#output ⇒ Object (readonly)
Returns the value of attribute output.
6 7 8 |
# File 'lib/mammoth/status.rb', line 6 def output @output 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, output: $stdout) ⇒ 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, output: $stdout) new(config, sqlite_store: sqlite_store, output: output).call end |
Instance Method Details
#call ⇒ void
This method returns an undefined value.
Print the status snapshot.
29 30 31 32 |
# File 'lib/mammoth/status.rb', line 29 def call status_lines.each { |line| output.puts(line) } print_store_state if sqlite_store end |