Class: SolidQueueUi::Web
- Inherits:
-
Object
- Object
- SolidQueueUi::Web
- Defined in:
- lib/solid_queue_ui/web.rb,
lib/solid_queue_ui/web/csrf_protection.rb
Defined Under Namespace
Classes: CsrfProtection
Constant Summary collapse
- ROOT =
File.("#{File.dirname(__FILE__)}/../../web")
- VIEWS =
"#{ROOT}/views"
- LOCALES =
["#{ROOT}/locales"]
- LAYOUT =
"#{VIEWS}/layout.html.erb"
- ASSETS =
"#{ROOT}/assets"
- DEFAULT_TABS =
{ "Dashboard" => "", }
- CONTENT_LANGUAGE =
"content-language"
- CONTENT_SECURITY_POLICY =
"content-security-policy"
- LOCATION =
"location"
- X_CASCADE =
"x-cascade"
Class Attribute Summary collapse
-
.app_url ⇒ Object
Returns the value of attribute app_url.
- .locales ⇒ Object
- .views ⇒ Object
Class Method Summary collapse
- .call(env) ⇒ Object
- .custom_job_info_rows ⇒ Object
- .default_tabs ⇒ Object
- .inherited(child) ⇒ Object
- .middlewares ⇒ Object
- .register(extension) ⇒ Object
- .set(attribute, value) ⇒ Object
- .settings ⇒ Object
- .use(*args, &block) ⇒ Object
Instance Method Summary collapse
- #app ⇒ Object
- #call(env) ⇒ Object
- #disable(*opts) ⇒ Object
- #enable(*opts) ⇒ Object
- #middlewares ⇒ Object
- #set(attribute, value) ⇒ Object
- #settings ⇒ Object
- #use(*args, &block) ⇒ Object
Class Attribute Details
.app_url ⇒ Object
Returns the value of attribute app_url.
68 69 70 |
# File 'lib/solid_queue_ui/web.rb', line 68 def app_url @app_url end |
.locales ⇒ Object
48 49 50 |
# File 'lib/solid_queue_ui/web.rb', line 48 def locales @locales ||= LOCALES end |
.views ⇒ Object
52 53 54 |
# File 'lib/solid_queue_ui/web.rb', line 52 def views @views ||= VIEWS end |
Class Method Details
.call(env) ⇒ Object
92 93 94 95 |
# File 'lib/solid_queue_ui/web.rb', line 92 def self.call(env) @app ||= new @app.call(env) end |
.custom_job_info_rows ⇒ Object
44 45 46 |
# File 'lib/solid_queue_ui/web.rb', line 44 def custom_job_info_rows @custom_job_info_rows ||= [] end |
.default_tabs ⇒ Object
40 41 42 |
# File 'lib/solid_queue_ui/web.rb', line 40 def default_tabs DEFAULT_TABS end |
.inherited(child) ⇒ Object
72 73 74 |
# File 'lib/solid_queue_ui/web.rb', line 72 def self.inherited(child) child.app_url = app_url end |
.middlewares ⇒ Object
56 57 58 |
# File 'lib/solid_queue_ui/web.rb', line 56 def middlewares @middlewares ||= [] end |
.register(extension) ⇒ Object
113 114 115 |
# File 'lib/solid_queue_ui/web.rb', line 113 def self.register(extension) extension.registered(WebApplication) end |
.set(attribute, value) ⇒ Object
64 65 66 |
# File 'lib/solid_queue_ui/web.rb', line 64 def set(attribute, value) send(:"#{attribute}=", value) end |
.settings ⇒ Object
36 37 38 |
# File 'lib/solid_queue_ui/web.rb', line 36 def settings self end |
.use(*args, &block) ⇒ Object
60 61 62 |
# File 'lib/solid_queue_ui/web.rb', line 60 def use(*args, &block) middlewares << [args, block] end |
Instance Method Details
#app ⇒ Object
97 98 99 |
# File 'lib/solid_queue_ui/web.rb', line 97 def app @app ||= build end |
#call(env) ⇒ Object
88 89 90 |
# File 'lib/solid_queue_ui/web.rb', line 88 def call(env) app.call(env) end |
#disable(*opts) ⇒ Object
105 106 107 |
# File 'lib/solid_queue_ui/web.rb', line 105 def disable(*opts) opts.each { |key| set(key, false) } end |
#enable(*opts) ⇒ Object
101 102 103 |
# File 'lib/solid_queue_ui/web.rb', line 101 def enable(*opts) opts.each { |key| set(key, true) } end |
#middlewares ⇒ Object
80 81 82 |
# File 'lib/solid_queue_ui/web.rb', line 80 def middlewares @middlewares ||= self.class.middlewares end |
#set(attribute, value) ⇒ Object
109 110 111 |
# File 'lib/solid_queue_ui/web.rb', line 109 def set(attribute, value) send(:"#{attribute}=", value) end |
#settings ⇒ Object
76 77 78 |
# File 'lib/solid_queue_ui/web.rb', line 76 def settings self.class.settings end |
#use(*args, &block) ⇒ Object
84 85 86 |
# File 'lib/solid_queue_ui/web.rb', line 84 def use(*args, &block) middlewares << [args, block] end |