Class: ZoomSlack::Config

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

Constant Summary collapse

TOKEN_DEFAULT_ENV =
"SLACK_API_TOKEN"
MEETING_TEXT_DEFAULT =
"In a meeting"
MEETING_EMOJI_DEFAULT =
":spiral_calendar_pad:"
MEETING_EXPIRES_IN_MIN_DEFAULT =
0
CLEAR_TEXT_DEFAULT =
nil
CLEAR_EMOJI_DEFAULT =
nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



16
17
18
19
20
21
22
23
# File 'lib/zoom_slack/config.rb', line 16

def initialize
  self.token = ENV[TOKEN_DEFAULT_ENV]
  self.meeting_text = MEETING_TEXT_DEFAULT
  self.meeting_emoji = MEETING_EMOJI_DEFAULT
  self.meeting_expires_in_min = MEETING_EXPIRES_IN_MIN_DEFAULT
  self.clear_text = CLEAR_TEXT_DEFAULT
  self.clear_emoji = CLEAR_EMOJI_DEFAULT
end

Instance Attribute Details

#clear_emojiObject

Returns the value of attribute clear_emoji.



12
13
14
# File 'lib/zoom_slack/config.rb', line 12

def clear_emoji
  @clear_emoji
end

#clear_textObject

Returns the value of attribute clear_text.



12
13
14
# File 'lib/zoom_slack/config.rb', line 12

def clear_text
  @clear_text
end

#meeting_emojiObject

Returns the value of attribute meeting_emoji.



12
13
14
# File 'lib/zoom_slack/config.rb', line 12

def meeting_emoji
  @meeting_emoji
end

#meeting_expires_in_minObject

Returns the value of attribute meeting_expires_in_min.



12
13
14
# File 'lib/zoom_slack/config.rb', line 12

def meeting_expires_in_min
  @meeting_expires_in_min
end

#meeting_textObject

Returns the value of attribute meeting_text.



12
13
14
# File 'lib/zoom_slack/config.rb', line 12

def meeting_text
  @meeting_text
end

#tokenObject

Returns the value of attribute token.



12
13
14
# File 'lib/zoom_slack/config.rb', line 12

def token
  @token
end

Instance Method Details

#meeting_expires_atObject



29
30
31
32
33
# File 'lib/zoom_slack/config.rb', line 29

def meeting_expires_at
  return nil if meeting_expires_in_min == 0

  Time.now.to_i + (meeting_expires_in_min * 60)
end