Sha256: 429716f77e288512e5714bb910f1cc8407c105acff85de6a2ce6d943d8495fa7

Contents?: true

Size: 474 Bytes

Versions: 4

Compression:

Stored size: 474 Bytes

Contents

##
# Argument Validation 是参数验证逻辑的关注点。

module Unidom::Common::Concerns::ArgumentValidation

  extend ActiveSupport::Concern

  included do |includer|

    def assert_present!(name, value)
      raise ArgumentError.new("The #{name} argument is required.") if value.blank?
    end

  end

  module ClassMethods

    def assert_present!(name, value)
      raise ArgumentError.new("The #{name} argument is required.") if value.blank?
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
unidom-common-1.9.2 app/models/unidom/common/concerns/argument_validation.rb
unidom-common-1.9.1 app/models/unidom/common/concerns/argument_validation.rb
unidom-common-1.9 app/models/unidom/common/concerns/argument_validation.rb
unidom-common-1.8.1 app/models/unidom/common/concerns/argument_validation.rb