Class: Baykit::BayServer::Util::IpMatcher
- Inherits:
-
Object
- Object
- Baykit::BayServer::Util::IpMatcher
- Defined in:
- lib/baykit/bayserver/util/ip_matcher.rb
Instance Attribute Summary collapse
-
#cidr_ip ⇒ Object
readonly
Returns the value of attribute cidr_ip.
-
#match_all ⇒ Object
readonly
Returns the value of attribute match_all.
Instance Method Summary collapse
-
#initialize(ip_desc) ⇒ IpMatcher
constructor
A new instance of IpMatcher.
- #match(ip) ⇒ Object
Constructor Details
#initialize(ip_desc) ⇒ IpMatcher
Returns a new instance of IpMatcher.
8 9 10 11 12 13 14 |
# File 'lib/baykit/bayserver/util/ip_matcher.rb', line 8 def initialize(ip_desc) @match_all = (ip_desc == "*") if !@match_all parse_cidr(ip_desc) end end |
Instance Attribute Details
#cidr_ip ⇒ Object (readonly)
Returns the value of attribute cidr_ip.
6 7 8 |
# File 'lib/baykit/bayserver/util/ip_matcher.rb', line 6 def cidr_ip @cidr_ip end |
#match_all ⇒ Object (readonly)
Returns the value of attribute match_all.
5 6 7 |
# File 'lib/baykit/bayserver/util/ip_matcher.rb', line 5 def match_all @match_all end |