class StatusPageRuby::Services::BuildHistoryTable
Constants
- HEADINGS
Attributes
status_repository[R]
Public Class Methods
new(status_repository)
click to toggle source
# File lib/status_page_ruby/services/build_history_table.rb, line 8 def initialize(status_repository) @status_repository = status_repository end
Public Instance Methods
call(service = nil)
click to toggle source
# 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
Private Instance Methods
build_rows(service)
click to toggle source
# File lib/status_page_ruby/services/build_history_table.rb, line 21 def build_rows(service) find_records(service).map(&:history_record) end
find_records(service)
click to toggle source
# File lib/status_page_ruby/services/build_history_table.rb, line 25 def find_records(service) return status_repository.all if service.nil? status_repository.where(service: service) end