Class: ParameterSubstitution::Formatters::BlankIfNil

Inherits:
Base
  • Object
show all
Defined in:
lib/parameter_substitution/formatters/blank_if_nil.rb

Class Method Summary collapse

Methods inherited from Base

encoding, has_parameters?, key, parse_duration

Class Method Details

.descriptionObject



4
5
6
# File 'lib/parameter_substitution/formatters/blank_if_nil.rb', line 4

def self.description
  "Converts nil values to empty strings: ''"
end

.format(value) ⇒ Object



8
9
10
# File 'lib/parameter_substitution/formatters/blank_if_nil.rb', line 8

def self.format(value)
  value.nil? ? "" : value
end