Class: GitHubPages::HealthCheck::CDN
- Inherits:
-
Object
- Object
- GitHubPages::HealthCheck::CDN
- Includes:
- Singleton
- Defined in:
- lib/github-pages-health-check/cdn.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Internal: The path of the config file.
-
#path ⇒ Object
readonly
Internal: The path of the config file.
Class Method Summary collapse
-
.controls_ip?(address) ⇒ Boolean
Public: Does cloudflare control this address?.
Instance Method Summary collapse
-
#controls_ip?(address) ⇒ Boolean
Internal: Does this CDN control this address?.
-
#initialize(options = {}) ⇒ CDN
constructor
Internal: Create a new CDN info instance.
Constructor Details
#initialize(options = {}) ⇒ CDN
Internal: Create a new CDN info instance.
17 18 19 20 |
# File 'lib/github-pages-health-check/cdn.rb', line 17 def initialize( = {}) @name = .fetch(:name) { self.class.name.split("::").last.downcase } @path = .fetch(:path) { default_config_path } end |
Instance Attribute Details
#name ⇒ Object (readonly)
Internal: The path of the config file.
9 10 11 |
# File 'lib/github-pages-health-check/cdn.rb', line 9 def name @name end |
#path ⇒ Object (readonly)
Internal: The path of the config file.
9 10 11 |
# File 'lib/github-pages-health-check/cdn.rb', line 9 def path @path end |
Class Method Details
.controls_ip?(address) ⇒ Boolean
Public: Does cloudflare control this address?
12 13 14 |
# File 'lib/github-pages-health-check/cdn.rb', line 12 def self.controls_ip?(address) instance.controls_ip?(address) end |
Instance Method Details
#controls_ip?(address) ⇒ Boolean
Internal: Does this CDN control this address?
23 24 25 |
# File 'lib/github-pages-health-check/cdn.rb', line 23 def controls_ip?(address) ranges.any? { |range| range.include?(address.to_s) } end |