Class: Karafka::Web::Ui::Models::Status::Step

Inherits:
Struct
  • Object
show all
Defined in:
lib/karafka/web/ui/models/status.rb

Overview

Status of a single step of setup

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detailsObject

Returns the value of attribute details

Returns:

  • (Object)

    the current value of details



16
17
18
# File 'lib/karafka/web/ui/models/status.rb', line 16

def details
  @details
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



16
17
18
# File 'lib/karafka/web/ui/models/status.rb', line 16

def status
  @status
end

Instance Method Details

#partial_namespaceString

Returns local namespace for partial of a given type.

Returns:

  • (String)

    local namespace for partial of a given type



23
24
25
26
27
28
29
30
31
32
# File 'lib/karafka/web/ui/models/status.rb', line 23

def partial_namespace
  case status
  when :success then 'successes'
  when :warning then 'warnings'
  when :failure then 'failures'
  when :halted  then 'failures'
  else
    raise ::Karafka::Errors::UnsupportedCaseError, status
  end
end

#success?Boolean

Returns is the given step successfully configured and working.

Returns:

  • (Boolean)

    is the given step successfully configured and working



18
19
20
# File 'lib/karafka/web/ui/models/status.rb', line 18

def success?
  status == :success || status == :warning
end

#to_sString

Returns stringified status.

Returns:

  • (String)

    stringified status



35
36
37
# File 'lib/karafka/web/ui/models/status.rb', line 35

def to_s
  status.to_s
end