Class: Indexmap::Pinger::Base
- Inherits:
-
Object
- Object
- Indexmap::Pinger::Base
- Defined in:
- lib/indexmap/pinger/base.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(configuration: Indexmap.configuration) ⇒ Base
constructor
A new instance of Base.
- #logger ⇒ Object
- #ping ⇒ Object
Constructor Details
#initialize(configuration: Indexmap.configuration) ⇒ Base
Returns a new instance of Base.
13 14 15 |
# File 'lib/indexmap/pinger/base.rb', line 13 def initialize(configuration: Indexmap.configuration) @configuration = configuration end |
Class Method Details
.ping ⇒ Object
9 10 11 |
# File 'lib/indexmap/pinger/base.rb', line 9 def self.ping(...) new(...).ping end |
Instance Method Details
#logger ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/indexmap/pinger/base.rb', line 23 def logger @logger ||= if defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger Rails.logger else Logger.new($stderr).tap do |logger| logger.level = Logger::WARN end end end |
#ping ⇒ Object
17 18 19 20 21 |
# File 'lib/indexmap/pinger/base.rb', line 17 def ping sitemap_files.each do |sitemap_file| ping_sitemap(sitemap_file) end end |