Class: GitHubPages::HealthCheck::CloudFlare

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/github-pages-health-check/cloudflare.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CloudFlare

Internal: Create a new cloudflare info instance.



15
16
17
# File 'lib/github-pages-health-check/cloudflare.rb', line 15

def initialize(options = {})
  @path = options.fetch(:path) { default_config_path }
end

Instance Attribute Details

#pathObject (readonly)

Internal: The path of the config file.



7
8
9
# File 'lib/github-pages-health-check/cloudflare.rb', line 7

def path
  @path
end

Class Method Details

.controls_ip?(address) ⇒ Boolean

Public: Does cloudflare control this address?

Returns:

  • (Boolean)


10
11
12
# File 'lib/github-pages-health-check/cloudflare.rb', line 10

def self.controls_ip?(address)
  instance.controls_ip?(address)
end

Instance Method Details

#controls_ip?(address) ⇒ Boolean

Internal: Does cloudflare control this address?

Returns:

  • (Boolean)


20
21
22
# File 'lib/github-pages-health-check/cloudflare.rb', line 20

def controls_ip?(address)
  ranges.any? { |range| range.include?(address) }
end