Class: SlackWebApi::Server
- Inherits:
-
Object
- Object
- SlackWebApi::Server
- Defined in:
- lib/slack_web_api/configuration.rb
Overview
An enum for API servers.
Constant Summary collapse
- SERVER =
[ DEFAULT = 'default'.freeze, AUTH_SERVER = 'auth server'.freeze ].freeze
Class Method Summary collapse
-
.from_value(value, default_value = DEFAULT) ⇒ Object
Converts a string or symbol into a valid Server constant.
Class Method Details
.from_value(value, default_value = DEFAULT) ⇒ Object
Converts a string or symbol into a valid Server constant.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/slack_web_api/configuration.rb', line 29 def self.from_value(value, default_value = DEFAULT) return default_value if value.nil? str = value.to_s.strip.downcase case str when 'default' then DEFAULT when 'auth_server' then AUTH_SERVER else warn "[Server] Unknown server '#{value}', falling back to #{default_value} " default_value end end |