2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-10-21 14:49:51 -04:00
|
|
|
class ScreenedIpAddressSerializer < ApplicationSerializer
|
2013-10-22 16:30:30 -04:00
|
|
|
attributes :id,
|
|
|
|
:ip_address,
|
2013-10-24 17:18:10 -04:00
|
|
|
:action_name,
|
2013-10-21 14:49:51 -04:00
|
|
|
:match_count,
|
|
|
|
:last_match_at,
|
|
|
|
:created_at
|
|
|
|
|
2013-10-24 17:18:10 -04:00
|
|
|
def action_name
|
2013-10-21 14:49:51 -04:00
|
|
|
ScreenedIpAddress.actions.key(object.action_type).to_s
|
|
|
|
end
|
|
|
|
|
2013-11-05 15:00:47 -05:00
|
|
|
def ip_address
|
2014-02-18 10:33:08 -05:00
|
|
|
object.ip_address_with_mask
|
2013-11-05 15:00:47 -05:00
|
|
|
end
|
|
|
|
|
2013-10-21 14:49:51 -04:00
|
|
|
end
|