Class: Jets::CLI::Maintenance::Web
- Defined in:
- lib/jets/cli/maintenance/web.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Web
constructor
A new instance of Web.
- #off ⇒ Object
- #on ⇒ Object
- #on? ⇒ Boolean
Methods inherited from Base
#paginate, #paging_params, rescue_api_error
Methods included from Util::Logging
Methods included from AwsServices
#apigateway, #aws_options, #cfn, #codebuild, #dynamodb, #lambda_client, #logs, #s3, #s3_resource, #sns, #sqs, #ssm, #sts, #wafv2
Methods included from AwsServices::StackStatus
Methods included from AwsServices::GlobalMemoist
Methods included from Api
Constructor Details
Instance Method Details
#off ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/jets/cli/maintenance/web.rb', line 18 def off if on? @lambda_function.environment_variables = {JETS_MAINTENANCE: nil} warn "Web maintenance has been turned off" else warn "Web maintenance is already off" end end |
#on ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/jets/cli/maintenance/web.rb', line 9 def on if on? warn "Web maintenance is already on" else @lambda_function.environment_variables = {JETS_MAINTENANCE: "on"} warn "Web maintenance has been turned on" end end |
#on? ⇒ Boolean
27 28 29 |
# File 'lib/jets/cli/maintenance/web.rb', line 27 def on? truthy?(@lambda_function.environment_variables["JETS_MAINTENANCE"]) end |