Sha256: 979a38520a08d5e49eab53307e25614bdfd09e4f329bf82ccc6f749616d2e015

Contents?: true

Size: 573 Bytes

Versions: 8

Compression:

Stored size: 573 Bytes

Contents

require 'metasploit/model/error'

module Metasploit
  module Model
    # Error raised if a {Metasploit::Model} ActiveModel is invalid.
    class Invalid < Metasploit::Model::Error
      def initialize(model)
        @model = model

        errors = @model.errors.full_messages.join(', ')
        # Must be called model_invalid so it doesn't alias errors.messages.invalid
        translated_message = ::I18n.translate('metasploit.model.errors.messages.model_invalid', :errors => errors)
        super(translated_message)
      end

      attr_reader :model
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
metasploit-model-0.27.3 lib/metasploit/model/invalid.rb
metasploit-model-0.27.3-java lib/metasploit/model/invalid.rb
metasploit-model-0.27.2 lib/metasploit/model/invalid.rb
metasploit-model-0.27.2-java lib/metasploit/model/invalid.rb
metasploit-model-0.27.1 lib/metasploit/model/invalid.rb
metasploit-model-0.27.1-java lib/metasploit/model/invalid.rb
metasploit-model-0.27.0 lib/metasploit/model/invalid.rb
metasploit-model-0.27.0-java lib/metasploit/model/invalid.rb