Sha256: c3e39843f0bc466e978412dd5850cccd8a75462c9bfd829844e88b318268c6dc

Contents?: true

Size: 475 Bytes

Versions: 1

Compression:

Stored size: 475 Bytes

Contents

# frozen_string_literal: true

#
# Copyright (c) 2019-present, Blue Marble Payroll, LLC
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

class CustomFormatter < Stringento::Formatter
  def yes_no_formatter(value, _arg)
    value ? 'Yes' : 'No'
  end

  def yes_no_unknown_formatter(value, _arg)
    if value.nil?
      'Unknown'
    elsif value
      'Yes'
    else
      'No'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stringento-2.1.0 spec/examples/custom_formatter.rb