Class: JefferiesTube::Rack::Maintenance
- Inherits:
-
Object
- Object
- JefferiesTube::Rack::Maintenance
- Defined in:
- lib/jefferies_tube/rack/maintenance.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Maintenance
constructor
A new instance of Maintenance.
Constructor Details
#initialize(app, options = {}) ⇒ Maintenance
Returns a new instance of Maintenance.
8 9 10 11 |
# File 'lib/jefferies_tube/rack/maintenance.rb', line 8 def initialize(app, ={}) @app = app @options = end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/jefferies_tube/rack/maintenance.rb', line 6 def app @app end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/jefferies_tube/rack/maintenance.rb', line 6 def @options end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 |
# File 'lib/jefferies_tube/rack/maintenance.rb', line 13 def call(env) = File.read('./tmp/maintenance.txt') = "Sorry, this site is down for maintenance." if .empty? [ 503, { "Content-Type" => "text/plain", "Content-Length" => .bytesize.to_s }, [] ] end |