Class: WebHookPublisher::Acl::RecordBase
- Inherits:
-
Object
- Object
- WebHookPublisher::Acl::RecordBase
- Defined in:
- lib/webhook-publisher/acl.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ipaddr ⇒ Object
readonly
Returns the value of attribute ipaddr.
Instance Method Summary collapse
- #include?(ipaddr) ⇒ Boolean
-
#initialize(ipaddr) ⇒ RecordBase
constructor
A new instance of RecordBase.
Constructor Details
#initialize(ipaddr) ⇒ RecordBase
Returns a new instance of RecordBase.
56 57 58 59 60 61 62 63 64 |
# File 'lib/webhook-publisher/acl.rb', line 56 def initialize(ipaddr) @ipaddr = case ipaddr when :all then IPAddr.new("0.0.0.0/0") when String then IPAddr.new(ipaddr) when IPAddr then ipaddr else raise(ArgumentError, "invalid IP address") end end |
Instance Attribute Details
#ipaddr ⇒ Object (readonly)
Returns the value of attribute ipaddr.
66 67 68 |
# File 'lib/webhook-publisher/acl.rb', line 66 def ipaddr @ipaddr end |
Instance Method Details
#include?(ipaddr) ⇒ Boolean
68 69 70 |
# File 'lib/webhook-publisher/acl.rb', line 68 def include?(ipaddr) return @ipaddr.include?(ipaddr) end |