Sha256: 6081d199d71b02ff8a7b4e0b3ea8ec433dcf19b0391a9dd6225c85dc315ca057
Contents?: true
Size: 696 Bytes
Versions: 13
Compression:
Stored size: 696 Bytes
Contents
module Shipit class StatusGroup STATES_PRIORITY = %w(failure error pending success).freeze attr_reader :statuses, :significant_status def initialize(significant_status, visible_statuses) @significant_status = significant_status @statuses = visible_statuses end delegate :pending?, :success?, :error?, :failure?, :state, to: :significant_status def description "#{success_count} / #{statuses.count} checks OK" end def target_url end def to_partial_path 'statuses/group' end def group? true end private def success_count @statuses.count { |s| s.state == 'success'.freeze } end end end
Version data entries
13 entries across 13 versions & 1 rubygems