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