Sha256: 51a3800b3069263ba4dc2642f1ba9f6e136838b2f5c645e59604ca443a68905a

Contents?: true

Size: 211 Bytes

Versions: 12

Compression:

Stored size: 211 Bytes

Contents

module HumanAttributes
  module Formatters
    class Boolean < Base
      def apply(_instance, value)
        key = !!value ? "positive" : "negative"
        I18n.t("boolean.#{key}")
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
human_attributes-1.1.0 lib/human_attributes/formatters/boolean.rb
human_attributes-1.0.0 lib/human_attributes/formatters/boolean.rb
human_attributes-0.7.1 lib/human_attributes/formatters/boolean.rb
human_attributes-0.7.0 lib/human_attributes/formatters/boolean.rb
human_attributes-0.6.0 lib/human_attributes/formatters/boolean.rb
human_attributes-0.5.0 lib/human_attributes/formatters/boolean.rb
human_attributes-0.4.0 lib/human_attributes/formatters/boolean.rb
human_attributes-0.3.1 lib/human_attributes/formatters/boolean.rb
human_attributes-0.3.0 lib/human_attributes/formatters/boolean.rb
human_attributes-0.2.0 lib/human_attributes/formatters/boolean.rb
human_attributes-0.1.1 lib/human_attributes/formatters/boolean.rb
human_attributes-0.1.0 lib/human_attributes/formatters/boolean.rb