Class: Slackify::Configuration

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

Overview

Where the configuration for Slackify lives

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
15
16
17
18
19
20
# File 'lib/slackify/configuration.rb', line 11

def initialize
  @slack_bot_token = nil
  @slack_secret_token = nil
  @handlers = generate_handlers
  @slack_client = nil
  @custom_message_subtype_handlers = {}
  @custom_event_type_handlers = {}
  @unhandled_handler = Handlers::UnhandledHandler
  @approved_bot_ids = []
end

Instance Attribute Details

#approved_bot_idsObject

Returns the value of attribute approved_bot_ids.



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

def approved_bot_ids
  @approved_bot_ids
end

#custom_event_type_handlersObject

Returns the value of attribute custom_event_type_handlers.



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

def custom_event_type_handlers
  @custom_event_type_handlers
end

#custom_message_subtype_handlersObject

Returns the value of attribute custom_message_subtype_handlers.



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

def custom_message_subtype_handlers
  @custom_message_subtype_handlers
end

#handlersObject

Returns the value of attribute handlers.



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

def handlers
  @handlers
end

#slack_bot_tokenObject

Returns the value of attribute slack_bot_token.



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

def slack_bot_token
  @slack_bot_token
end

#slack_clientObject

Returns the value of attribute slack_client.



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

def slack_client
  @slack_client
end

#slack_secret_tokenObject

Returns the value of attribute slack_secret_token.



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

def slack_secret_token
  @slack_secret_token
end

#unhandled_handlerObject

Returns the value of attribute unhandled_handler.



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

def unhandled_handler
  @unhandled_handler
end

Instance Method Details

#remove_unhandled_handlerObject

Remove unhandled handler. The bot will not reply if the message doesn’t match any regex



32
33
34
# File 'lib/slackify/configuration.rb', line 32

def remove_unhandled_handler
  @unhandled_handler = nil
end