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