Sha256: 0c810bd131ed7f02fe8a8087437bfb44a76b88e10dbc3354ea7c1d2ab523c44b
Contents?: true
Size: 610 Bytes
Versions: 217
Compression:
Stored size: 610 Bytes
Contents
module Avo module Fields class StatusField < BaseField def initialize(id, **args, &block) super(id, **args, &block) @loading_when = args[:loading_when].present? ? [args[:loading_when]].flatten : [:waiting, :running] @failed_when = args[:failed_when].present? ? [args[:failed_when]].flatten : [:failed] end def status status = "success" if value.present? status = "failed" if @failed_when.include? value.to_sym status = "loading" if @loading_when.include? value.to_sym end status end end end end
Version data entries
217 entries across 217 versions & 1 rubygems