Sha256: f74840148db4e4f8f31630a30ae0f1034aa7202df1006307cb32db57c5921efd

Contents?: true

Size: 749 Bytes

Versions: 6

Compression:

Stored size: 749 Bytes

Contents

# frozen_string_literal: true

class Serega
  module Plugins
    module Metadata
      class MetaAttribute
        class CheckOptHideEmpty
          class << self
            #
            # Checks attribute :after_hide_if option
            #
            # @param opts [Hash] Attribute options
            #
            # @raise [Error] Error 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 Error, "Invalid option :hide_empty => #{value.inspect}. Must be true"
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serega-0.1.5 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.1.4 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.1.3 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.1.2 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.1.1 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb
serega-0.1.0 lib/serega/plugins/metadata/validations/check_opt_hide_empty.rb