Class: StatusPageRuby::Services::BuildHistoryTable

Inherits:
Object
  • Object
show all
Defined in:
lib/status_page_ruby/services/build_history_table.rb

Constant Summary collapse

HEADINGS =
%w[Service Status Time].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_repository) ⇒ BuildHistoryTable

Returns a new instance of BuildHistoryTable.



8
9
10
# File 'lib/status_page_ruby/services/build_history_table.rb', line 8

def initialize(status_repository)
  @status_repository = status_repository
end

Instance Attribute Details

#status_repositoryObject (readonly)

Returns the value of attribute status_repository.



6
7
8
# File 'lib/status_page_ruby/services/build_history_table.rb', line 6

def status_repository
  @status_repository
end

Instance Method Details

#call(service = nil) ⇒ Object



12
13
14
15
16
17
# File 'lib/status_page_ruby/services/build_history_table.rb', line 12

def call(service = nil)
  Terminal::Table.new(
    headings: HEADINGS,
    rows: build_rows(service)
  ).to_s
end