Sha256: d6ccec0c2b2bff9b73ec7bc25ce84bf2f29312cb5d7957384c556b9f869705cc

Contents?: true

Size: 765 Bytes

Versions: 8

Compression:

Stored size: 765 Bytes

Contents

# frozen_string_literal: true

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

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
serega-0.6.1 lib/serega/plugins/metadata/validations/check_opt_hide_nil.rb
serega-0.6.0 lib/serega/plugins/metadata/validations/check_opt_hide_nil.rb
serega-0.5.2 lib/serega/plugins/metadata/validations/check_opt_hide_nil.rb
serega-0.5.1 lib/serega/plugins/metadata/validations/check_opt_hide_nil.rb
serega-0.5.0 lib/serega/plugins/metadata/validations/check_opt_hide_nil.rb
serega-0.4.0 lib/serega/plugins/metadata/validations/check_opt_hide_nil.rb
serega-0.3.0 lib/serega/plugins/metadata/validations/check_opt_hide_nil.rb
serega-0.2.0 lib/serega/plugins/metadata/validations/check_opt_hide_nil.rb