class Wpxf::Models::LootItem

A loot item acquired from a target.

Public Instance Methods

before_destroy() click to toggle source
Calls superclass method
# File lib/wpxf/models/loot_item.rb, line 31
def before_destroy
  super
  FileUtils.rm path if File.exist?(path)
end
validate() click to toggle source
Calls superclass method
# File lib/wpxf/models/loot_item.rb, line 13
def validate
  super

  validates_presence :host
  validates_presence :port
  validates_presence :path

  validates_numeric :port
  validates_type String, :path, allow_nil: true
  validates_type String, :type, allow_nil: false
  validates_type String, :notes, allow_nil: true

  validates_max_length 500, :path
  validates_max_length 250, :host
  validates_max_length 50, :type
  validates_max_length 100, :notes, allow_nil: true
end