Class: Pairity::Slackbot
- Inherits:
-
Object
- Object
- Pairity::Slackbot
- Defined in:
- lib/pairity/slackbot.rb
Instance Method Summary collapse
-
#initialize ⇒ Slackbot
constructor
A new instance of Slackbot.
- #post(message) ⇒ Object
- #slack_channel ⇒ Object
Constructor Details
#initialize ⇒ Slackbot
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/pairity/slackbot.rb', line 6 def initialize Config.load hook = Config.get(:url) = { icon_url: 'https://static1.squarespace.com/static/54e22d6be4b00617871820ca/54e567bbe4b022f3194c63b5/55ddd86ae4b0f0c3127f8483/1440605037480/?format=1000w', username: 'Pairity', channel: slack_channel } @poster = Slack::Poster.new(hook, ) end |
Instance Method Details
#post(message) ⇒ Object
17 18 19 |
# File 'lib/pairity/slackbot.rb', line 17 def post() @poster.() end |
#slack_channel ⇒ Object
21 22 23 24 25 |
# File 'lib/pairity/slackbot.rb', line 21 def slack_channel channel = Config.get(:channel) return "#" + channel unless channel =~ /^#/ channel end |