Class: CautionTape::Configuration
- Inherits:
-
Object
- Object
- CautionTape::Configuration
- Defined in:
- lib/caution_tape/configuration.rb
Overview
Runtime configuration for the injected chrome.
Constant Summary collapse
- STYLES =
%i[stripes solid].freeze
Instance Attribute Summary collapse
-
#banner ⇒ Object
Full-width warning pill pinned top-center, e.g.
-
#border_width ⇒ Object
Frame thickness in px.
-
#color ⇒ Object
Accent color.
-
#enabled ⇒ Object
Whether any chrome is rendered at all.
-
#style ⇒ Object
:stripes — diagonal caution stripes (accent color + black).
-
#tag ⇒ Object
Small label pill (e.g. "Dev") shown when no banner is set.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
29 30 31 32 33 34 35 36 |
# File 'lib/caution_tape/configuration.rb', line 29 def initialize @enabled = false @style = :stripes @color = "#f5c518" @banner = nil @tag = nil @border_width = 10 end |
Instance Attribute Details
#banner ⇒ Object
Full-width warning pill pinned top-center, e.g. "Sandbox — do not enter real data." nil renders no banner.
21 22 23 |
# File 'lib/caution_tape/configuration.rb', line 21 def @banner end |
#border_width ⇒ Object
Frame thickness in px.
27 28 29 |
# File 'lib/caution_tape/configuration.rb', line 27 def border_width @border_width end |
#color ⇒ Object
Accent color. Stripes pair it with near-black; solid uses it alone.
17 18 19 |
# File 'lib/caution_tape/configuration.rb', line 17 def color @color end |
#enabled ⇒ Object
Whether any chrome is rendered at all. Defaults to off so production is safe by default — enable explicitly per environment.
10 11 12 |
# File 'lib/caution_tape/configuration.rb', line 10 def enabled @enabled end |
#style ⇒ Object
:stripes — diagonal caution stripes (accent color + black). :solid — a plain frame in the accent color.
14 15 16 |
# File 'lib/caution_tape/configuration.rb', line 14 def style @style end |
#tag ⇒ Object
Small label pill (e.g. "Dev") shown when no banner is set. nil hides it.
24 25 26 |
# File 'lib/caution_tape/configuration.rb', line 24 def tag @tag end |