Module: SlackRubyBot::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/slack-ruby-bot/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#aliasesObject

Returns the value of attribute aliases.



7
8
9
# File 'lib/slack-ruby-bot/config.rb', line 7

def aliases
  @aliases
end

#teamObject

Returns the value of attribute team.



10
11
12
# File 'lib/slack-ruby-bot/config.rb', line 10

def team
  @team
end

#team_idObject

Returns the value of attribute team_id.



11
12
13
# File 'lib/slack-ruby-bot/config.rb', line 11

def team_id
  @team_id
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/slack-ruby-bot/config.rb', line 5

def token
  @token
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/slack-ruby-bot/config.rb', line 6

def url
  @url
end

#userObject

Returns the value of attribute user.



8
9
10
# File 'lib/slack-ruby-bot/config.rb', line 8

def user
  @user
end

#user_idObject

Returns the value of attribute user_id.



9
10
11
# File 'lib/slack-ruby-bot/config.rb', line 9

def user_id
  @user_id
end

Instance Method Details

#name?(name) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/slack-ruby-bot/config.rb', line 17

def name?(name)
  name && names.include?(name.downcase)
end

#namesObject



13
14
15
# File 'lib/slack-ruby-bot/config.rb', line 13

def names
  [user, aliases, "<@#{user_id.downcase}>", "<@#{user_id.downcase}>:"].compact.flatten
end