Class: DeviseSlackNotifiable::Configuration

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

Overview

Configuration container

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

DeviseSlackNotifiable::Configuration constructor.

Sets default values



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/devise_slack_notifiable/configuration.rb', line 16

def initialize
  @enabled = false
  @slack_webhook = nil
  @confirmation_message_enabled = true

  @context_fields = %i[id email]

  @registration_message_formatter = lambda { |entity|
    "Yeah 🎉! Looks like we have new #{entity.model_name.human}! 😊"
  }

  @confirmation_message_formatter = lambda { |entity|
    "#{entity.model_name.human} have just confirmed his account 🥂"
  }
end

Instance Attribute Details

#confirmation_message_enabledObject

Returns the value of attribute confirmation_message_enabled.



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

def confirmation_message_enabled
  @confirmation_message_enabled
end

#confirmation_message_formatterObject

Returns the value of attribute confirmation_message_formatter.



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

def confirmation_message_formatter
  @confirmation_message_formatter
end

#context_fieldsObject

Returns the value of attribute context_fields.



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

def context_fields
  @context_fields
end

#enabledObject

Returns the value of attribute enabled.



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

def enabled
  @enabled
end

#registration_message_formatterObject

Returns the value of attribute registration_message_formatter.



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

def registration_message_formatter
  @registration_message_formatter
end

#slack_webhookObject

Returns the value of attribute slack_webhook.



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

def slack_webhook
  @slack_webhook
end