Sha256: 51f22eb13dfe984c3223274f4c7067b65d5260f5ad968924b43bda7974d033c8
Contents?: true
Size: 1010 Bytes
Versions: 6
Compression:
Stored size: 1010 Bytes
Contents
# frozen_string_literal: true class Serega module SeregaPlugins module Metadata class MetaAttribute # # MetaAttribute `:const` option validator # class CheckOptConst class << self # # Checks meta_attribute :const option # # @param opts [Hash] MetaAttribute options # # @raise [SeregaError] validation error # # @return [void] # def call(opts, block = nil) return unless opts.key?(:const) check_usage_with_other_params(opts, block) end private def check_usage_with_other_params(opts, block) raise SeregaError, "Option :const can not be used together with option :value" if opts.key?(:value) raise SeregaError, "Option :const can not be used together with block" if block end end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems