Class: Threatinator::Model::Base

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations, Validations
Defined in:
lib/threatinator/model/base.rb

Direct Known Subclasses

Event, Observables::Ipv4

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



12
13
14
# File 'lib/threatinator/model/base.rb', line 12

def initialize
  validate!
end

Instance Method Details

#validate!Object



16
17
18
19
20
# File 'lib/threatinator/model/base.rb', line 16

def validate!
  unless valid?
    raise Threatinator::Exceptions::InvalidAttributeError, errors.full_messages.join("\n")
  end
end