Class: Rack::ErrorToSlack::Configuration

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

Overview

Configuration Class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
15
16
17
# File 'lib/rack/error_to_slack/configuration.rb', line 11

def initialize
  @webhook_url = nil
  @emoji = ':innocent:'
  @slackname = 'ErrorToSlack'
  @branch = `git rev-parse --abbrev-ref HEAD`.chomp || 'SOME BRANCH'
  @username = `whoami`.chomp || 'Anonymous'
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



8
9
10
# File 'lib/rack/error_to_slack/configuration.rb', line 8

def branch
  @branch
end

#emojiObject

Returns the value of attribute emoji.



6
7
8
# File 'lib/rack/error_to_slack/configuration.rb', line 6

def emoji
  @emoji
end

#slacknameObject

Returns the value of attribute slackname.



7
8
9
# File 'lib/rack/error_to_slack/configuration.rb', line 7

def slackname
  @slackname
end

#usernameObject (readonly)

Returns the value of attribute username.



9
10
11
# File 'lib/rack/error_to_slack/configuration.rb', line 9

def username
  @username
end

#webhook_urlObject

Returns the value of attribute webhook_url.



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

def webhook_url
  @webhook_url
end