Class: EmojiDiffer::Config
- Inherits:
-
Object
- Object
- EmojiDiffer::Config
- Defined in:
- lib/emoji_differ/config.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #read_token_file ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
5 6 7 8 |
# File 'lib/emoji_differ/config.rb', line 5 def initialize @token = nil @cache_location = nil end |
Instance Attribute Details
#cache_location ⇒ Object
18 19 20 |
# File 'lib/emoji_differ/config.rb', line 18 def cache_location @cache_location || ENV['EMOJI_CACHE_LOCATION'] || 'emoji_cache' end |
#token ⇒ Object
14 15 16 |
# File 'lib/emoji_differ/config.rb', line 14 def token @token || ENV['SLACK_API_TOKEN'] || read_token_file end |
Instance Method Details
#read_token_file ⇒ Object
10 11 12 |
# File 'lib/emoji_differ/config.rb', line 10 def read_token_file @file_token ||= File.exists?('.slack_token') ? File.read('.slack_token') : nil end |