Class: Avm::Launcher::Publish::CheckResult

Inherits:
Object
  • Object
show all
Includes:
EacRubyUtils::Listable
Defined in:
lib/avm/launcher/publish/check_result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, message) ⇒ CheckResult

Returns a new instance of CheckResult.



45
46
47
48
49
50
51
# File 'lib/avm/launcher/publish/check_result.rb', line 45

def initialize(status, message)
  raise "Status \"#{status}\" not in #{self.class.lists.status.values}" unless
  self.class.lists.status.values.include?(status)

  @status = status
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



43
44
45
# File 'lib/avm/launcher/publish/check_result.rb', line 43

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



43
44
45
# File 'lib/avm/launcher/publish/check_result.rb', line 43

def status
  @status
end

Class Method Details

.blocked_colorObject



34
35
36
# File 'lib/avm/launcher/publish/check_result.rb', line 34

def blocked_color
  'red'
end

.outdated_colorObject



38
39
40
# File 'lib/avm/launcher/publish/check_result.rb', line 38

def outdated_color
  'light_blue'
end

.pending_colorObject



30
31
32
# File 'lib/avm/launcher/publish/check_result.rb', line 30

def pending_color
  'yellow'
end

.pending_status?(status) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/avm/launcher/publish/check_result.rb', line 22

def pending_status?(status)
  [STATUS_PENDING].include?(status)
end

.updated_colorObject



26
27
28
# File 'lib/avm/launcher/publish/check_result.rb', line 26

def updated_color
  'green'
end

Instance Method Details

#to_sObject



53
54
55
# File 'lib/avm/launcher/publish/check_result.rb', line 53

def to_s
  message.light_white.send("on_#{background_color}")
end