Exception: Metasploit::Model::Invalid

Inherits:
Error
  • Object
show all
Defined in:
lib/metasploit/model/invalid.rb

Overview

Error raised if a Metasploit::Model ActiveModel is invalid.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Invalid

Returns a new instance of Invalid.


3
4
5
6
7
8
9
10
# File 'lib/metasploit/model/invalid.rb', line 3

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

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model


12
13
14
# File 'lib/metasploit/model/invalid.rb', line 12

def model
  @model
end