Module: ExceptionNotification::ConsiderLocal::ClassMethods
- Defined in:
- lib/exception_notification/consider_local.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(target) ⇒ Object
5 6 7 8 |
# File 'lib/exception_notification/consider_local.rb', line 5 def self.included(target) require 'ipaddr' target.extend(ClassMethods) end |
Instance Method Details
#consider_local(*args) ⇒ Object
10 11 12 |
# File 'lib/exception_notification/consider_local.rb', line 10 def consider_local(*args) local_addresses.concat(args.flatten.map { |a| IPAddr.new(a) }) end |
#local_addresses ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/exception_notification/consider_local.rb', line 14 def local_addresses addresses = read_inheritable_attribute(:local_addresses) unless addresses addresses = [IPAddr.new("127.0.0.1")] write_inheritable_attribute(:local_addresses, addresses) end addresses end |