Method: IPAccessDenied#reason

Defined in:
lib/ipaccess/ip_access_errors.rb

#reasonObject

Returns a string representing a reason of adding to a black list or nil if there was no reason given.



182
183
184
185
186
# File 'lib/ipaccess/ip_access_errors.rb', line 182

def reason
  return nil unless (rule.respond_to?(:tag) && rule.tag.respond_to?(:has_key?))
  r = rule.tag[:Reason_black]
  return r.nil? ? r : r.to_s
end