Class: StatusPageRuby::Services::BuildStatsTable
- Inherits:
-
Object
- Object
- StatusPageRuby::Services::BuildStatsTable
- Defined in:
- lib/status_page_ruby/services/build_stats_table.rb
Constant Summary collapse
- HEADINGS =
['Service', 'Up since', 'Down time'].freeze
- SECONDS_IN_MINUTE =
60- SECONDS_IN_HOUR =
3600- SECONDS_IN_DAY =
86_400
Instance Attribute Summary collapse
-
#status_repository ⇒ Object
readonly
Returns the value of attribute status_repository.
Instance Method Summary collapse
- #call(service = nil) ⇒ Object
-
#initialize(status_repository) ⇒ BuildStatsTable
constructor
A new instance of BuildStatsTable.
Constructor Details
#initialize(status_repository) ⇒ BuildStatsTable
Returns a new instance of BuildStatsTable.
11 12 13 |
# File 'lib/status_page_ruby/services/build_stats_table.rb', line 11 def initialize(status_repository) @status_repository = status_repository end |
Instance Attribute Details
#status_repository ⇒ Object (readonly)
Returns the value of attribute status_repository.
9 10 11 |
# File 'lib/status_page_ruby/services/build_stats_table.rb', line 9 def status_repository @status_repository end |
Instance Method Details
#call(service = nil) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/status_page_ruby/services/build_stats_table.rb', line 15 def call(service = nil) Terminal::Table.new( headings: HEADINGS, rows: build_rows(service) ).to_s end |