class Shack::Configuration
Used to configure the middleware
Attributes
content[RW]
A string (can be html) that will be displayed in the UI
hide_stamp[RW]
Boolean. Show or hide the samp
horizontal[RW]
Sets the horizontal placement. :left or :right (default to :right)
sha[RW]
The sha that should be displayed
vertical[RW]
Sets the vertical placement. :top or : bottom (defaults to :bottom)
Public Class Methods
new()
click to toggle source
# File lib/shack/configuration.rb, line 21 def initialize @vertical = :bottom @horizontal = :right end
Public Instance Methods
[](key)
click to toggle source
# File lib/shack/configuration.rb, line 26 def [](key) if respond_to? key public_send(key) end end
hide_stamp?()
click to toggle source
# File lib/shack/configuration.rb, line 38 def hide_stamp? !!hide_stamp end
horizontal=(thing)
click to toggle source
# File lib/shack/configuration.rb, line 42 def horizontal=(thing) if [:left, :right].include? thing @horizontal = thing else fail ArgumentError.new("horizontal needs to be :left or :right") end end
to_hash()
click to toggle source
# File lib/shack/configuration.rb, line 32 def to_hash {content: content, vertical: vertical, horizontal: horizontal} end
vertical=(thing)
click to toggle source
# File lib/shack/configuration.rb, line 50 def vertical=(thing) if [:top, :bottom].include? thing @vertical = thing else fail ArgumentError.new("vertical needs to be :top or :bottom") end end