Class: SlackNotifier::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/slack_notifier/config.rb

Constant Summary collapse

PRESET_REPORT_TITLE =
'Details'
PRESET_REPORT_COLOR =
'#D3D3D3'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_channelObject (readonly)

Returns the value of attribute default_channel.



7
8
9
# File 'lib/slack_notifier/config.rb', line 7

def default_channel
  @default_channel
end

.default_icon_emojiObject (readonly)

Returns the value of attribute default_icon_emoji.



7
8
9
# File 'lib/slack_notifier/config.rb', line 7

def default_icon_emoji
  @default_icon_emoji
end

.default_nicknameObject (readonly)

Returns the value of attribute default_nickname.



7
8
9
# File 'lib/slack_notifier/config.rb', line 7

def default_nickname
  @default_nickname
end

.default_report_colorObject (readonly)

Returns the value of attribute default_report_color.



7
8
9
# File 'lib/slack_notifier/config.rb', line 7

def default_report_color
  @default_report_color
end

.default_report_titleObject (readonly)

Returns the value of attribute default_report_title.



7
8
9
# File 'lib/slack_notifier/config.rb', line 7

def default_report_title
  @default_report_title
end

.raise_delivery_errorsObject (readonly)

Returns the value of attribute raise_delivery_errors.



7
8
9
# File 'lib/slack_notifier/config.rb', line 7

def raise_delivery_errors
  @raise_delivery_errors
end

.webhook_urlObject (readonly)

Returns the value of attribute webhook_url.



7
8
9
# File 'lib/slack_notifier/config.rb', line 7

def webhook_url
  @webhook_url
end

Class Method Details

.set(config) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/slack_notifier/config.rb', line 10

def set(config)
  @default_channel = config[:default_channel]
  @default_nickname = config[:default_nickname]
  @default_icon_emoji = config[:default_icon_emoji]
  @default_report_title = config[:default_report_title] || PRESET_REPORT_TITLE
  @default_report_color = config[:default_report_color] || PRESET_REPORT_COLOR
  @webhook_url = config[:webhook_url]
  @raise_delivery_errors = config[:raise_delivery_errors]
end