Sha256: c2a133e061b3aa644eb1f8bfd3a1b154019e1a35e20e55ffa2eeadffd62d32c7
Contents?: true
Size: 738 Bytes
Versions: 16
Compression:
Stored size: 738 Bytes
Contents
# Superclass for all Metasploit::Models. Just adds a default {#initialize} to make models mimic behavior of # ApplicationRecord subclasses. class Metasploit::Model::Base include ActiveModel::Validations # After ActiveModel::Validations so Metasploit::Model::Translation is favored over ActiveModel::Translation include Metasploit::Model::Translation # @param attributes [Hash{Symbol => String,nil}] def initialize(attributes={}) attributes.each do |attribute, value| public_send("#{attribute}=", value) end end # Validates the model. # # @return [void] # @raise [Metasploit::Model::Invalid] if invalid def valid! unless valid? raise Metasploit::Model::Invalid.new(self) end end end
Version data entries
16 entries across 16 versions & 1 rubygems