Class: HttpHealthCheck::Config::Dsl

Inherits:
Object
  • Object
show all
Defined in:
lib/http_health_check/config/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDsl

Returns a new instance of Dsl.



6
7
8
# File 'lib/http_health_check/config/dsl.rb', line 6

def initialize
  @routes = {}
end

Instance Attribute Details

#configured_fallback_appObject (readonly)

Returns the value of attribute configured_fallback_app.



9
10
11
# File 'lib/http_health_check/config/dsl.rb', line 9

def configured_fallback_app
  @configured_fallback_app
end

#configured_loggerObject (readonly)

Returns the value of attribute configured_logger.



9
10
11
# File 'lib/http_health_check/config/dsl.rb', line 9

def configured_logger
  @configured_logger
end

#routesObject (readonly)

Returns the value of attribute routes.



9
10
11
# File 'lib/http_health_check/config/dsl.rb', line 9

def routes
  @routes
end

Instance Method Details

#fallback_app(handler = nil, &block) ⇒ Object



15
16
17
# File 'lib/http_health_check/config/dsl.rb', line 15

def fallback_app(handler = nil, &block)
  @configured_fallback_app = block_given? ? block : handler
end

#logger(logger) ⇒ Object



19
20
21
# File 'lib/http_health_check/config/dsl.rb', line 19

def logger(logger)
  @configured_logger = logger
end

#probe(path, handler = nil, &block) ⇒ Object



11
12
13
# File 'lib/http_health_check/config/dsl.rb', line 11

def probe(path, handler = nil, &block)
  @routes[path] = block_given? ? block : handler
end