Sha256: 2c5d281ac32f42537261a0beb2f277b6bf2f4ef03c36cda8ad85a5925a86cdf2

Contents?: true

Size: 848 Bytes

Versions: 20

Compression:

Stored size: 848 Bytes

Contents

# frozen_string_literal: true

class Serega
  module SeregaPlugins
    module Metadata
      class MetaAttribute
        #
        # Validator for meta_attribute :hide_empty option
        #
        class CheckOptHideEmpty
          class << self
            #
            # Checks attribute :hide_empty option
            #
            # @param opts [Hash] Attribute options
            #
            # @raise [SeregaError] SeregaError that option has invalid value
            #
            # @return [void]
            #
            def call(opts)
              return unless opts.key?(:hide_empty)

              value = opts[:hide_empty]
              return if value == true

              raise SeregaError, "Invalid option :hide_empty => #{value.inspect}. Must be true"
            end
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
serega-0.21.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.20.1 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.20.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.19.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.18.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.17.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.16.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.15.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.14.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.12.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.11.2 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.11.1 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.11.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.10.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.9.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.8.3 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.8.2 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.8.1 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.8.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.7.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb