Class: Shack::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/shack/configuration.rb

Overview

Used to configure the middleware

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#contentObject

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_stampObject

Boolean. Show or hide the samp



11
12
13
# File 'lib/shack/configuration.rb', line 11

def hide_stamp
  @hide_stamp
end

#horizontalObject

Sets the horizontal placement. :left or :right (default to :right)



19
20
21
# File 'lib/shack/configuration.rb', line 19

def horizontal
  @horizontal
end

#shaObject

The sha that should be displayed



5
6
7
# File 'lib/shack/configuration.rb', line 5

def sha
  @sha
end

#verticalObject

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

Returns:

  • (Boolean)


38
39
40
# File 'lib/shack/configuration.rb', line 38

def hide_stamp?
  !!hide_stamp
end

#to_hashObject



32
33
34
35
36
# File 'lib/shack/configuration.rb', line 32

def to_hash
  {content: content,
   vertical: vertical,
   horizontal: horizontal}
end