Class: HealthBit::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/health_bit/formatter.rb

Overview

rubocop:disable Lint/UnusedMethodArgument

Instance Method Summary collapse

Instance Method Details

#code_failure(error, env, health_bit) ⇒ Object

Parameters:

  • error

    HealthBit::CheckError

  • env

    Hash

  • health_bit

    HealthBit



46
47
48
# File 'lib/health_bit/formatter.rb', line 46

def code_failure(error, env, health_bit)
  health_bit.fail_code
end

#code_success(env, health_bit) ⇒ Object

Parameters:

  • env

    Hash

  • health_bit

    HealthBit



39
40
41
# File 'lib/health_bit/formatter.rb', line 39

def code_success(env, health_bit)
  health_bit.success_code
end

#format_failure(error, env, health_bit) ⇒ Object

Parameters:

  • error

    HealthBit::CheckError

  • env

    Hash

  • health_bit

    HealthBit



19
20
21
22
# File 'lib/health_bit/formatter.rb', line 19

def format_failure(error, env, health_bit)
  format = health_bit.show_backtrace ? CheckError::FORMAT_FULL : CheckError::FORMAT_SHORT
  error.to_s(format)
end

#format_success(error, env, health_bit) ⇒ Object

Parameters:

  • error

    HealthBit::CheckError

  • env

    Hash

  • health_bit

    HealthBit



12
13
14
# File 'lib/health_bit/formatter.rb', line 12

def format_success(error, env, health_bit)
  health_bit.success_text
end

#headers_failure(error, env, health_bit) ⇒ Object

Parameters:

  • error

    HealthBit::CheckError

  • env

    Hash

  • health_bit

    HealthBit



33
34
35
# File 'lib/health_bit/formatter.rb', line 33

def headers_failure(error, env, health_bit)
  health_bit.headers
end

#headers_success(env, health_bit) ⇒ Object

Parameters:

  • env

    Hash

  • health_bit

    HealthBit



26
27
28
# File 'lib/health_bit/formatter.rb', line 26

def headers_success(env, health_bit)
  health_bit.headers
end