Class: Shack::Configuration
- Inherits:
-
Object
- Object
- Shack::Configuration
- Defined in:
- lib/shack/configuration.rb
Overview
Used to configure the middleware
Instance Attribute Summary collapse
-
#content ⇒ Object
A string (can be html) that will be displayed in the UI.
-
#hide_stamp ⇒ Object
Boolean.
-
#horizontal ⇒ Object
Sets the horizontal placement.
-
#sha ⇒ Object
The sha that should be displayed.
-
#vertical ⇒ Object
Sets the vertical placement.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #hide_stamp? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 |
# File 'lib/shack/configuration.rb', line 21 def initialize @vertical = :bottom @horizontal = :right end |
Instance Attribute Details
#content ⇒ Object
A string (can be html) that will be displayed in the UI
8 9 10 |
# File 'lib/shack/configuration.rb', line 8 def content @content end |
#hide_stamp ⇒ Object
Boolean. Show or hide the samp
11 12 13 |
# File 'lib/shack/configuration.rb', line 11 def hide_stamp @hide_stamp end |
#horizontal ⇒ Object
Sets the horizontal placement. :left or :right (default to :right)
19 20 21 |
# File 'lib/shack/configuration.rb', line 19 def horizontal @horizontal end |
#sha ⇒ Object
The sha that should be displayed
5 6 7 |
# File 'lib/shack/configuration.rb', line 5 def sha @sha end |
#vertical ⇒ Object
Sets the vertical placement. :top or : bottom (defaults to :bottom)
15 16 17 |
# File 'lib/shack/configuration.rb', line 15 def vertical @vertical end |
Instance Method Details
#[](key) ⇒ Object
26 27 28 29 30 |
# File 'lib/shack/configuration.rb', line 26 def [](key) if respond_to? key public_send(key) end end |
#hide_stamp? ⇒ Boolean
38 39 40 |
# File 'lib/shack/configuration.rb', line 38 def hide_stamp? !!hide_stamp end |
#to_hash ⇒ Object
32 33 34 35 36 |
# File 'lib/shack/configuration.rb', line 32 def to_hash {content: content, vertical: vertical, horizontal: horizontal} end |