Class: Crawlberg::HostMatcherCidr

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
HostMatcher
Defined in:
lib/crawlberg/native.rb

Overview

CIDR match: "10.0.0.0/8" matches IP addresses in that range.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valueObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



304
305
306
# File 'lib/crawlberg/native.rb', line 304

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object



321
322
323
# File 'lib/crawlberg/native.rb', line 321

def self.from_hash(hash)
  new(value: hash[:value] || hash["value"])
end

Instance Method Details

#cidr?Boolean

Returns:

  • (Boolean)


317
318
319
# File 'lib/crawlberg/native.rb', line 317

def cidr? = true
# @param hash [Hash] deserialized from the native extension
# @return [self]

#exact?Boolean

Returns:

  • (Boolean)


313
# File 'lib/crawlberg/native.rb', line 313

def exact? = false

#suffix?Boolean

Returns:

  • (Boolean)


315
# File 'lib/crawlberg/native.rb', line 315

def suffix? = false