Module: Hipnote

Defined in:
lib/hipnote.rb,
lib/hipnote/version.rb

Constant Summary collapse

VERSION =
"0.0.5"

Class Method Summary collapse

Class Method Details

.post(options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/hipnote.rb', line 8

def self.post(options = {})
  user = options[:user] || 'Message'
  msg = options[:msg]
  format = options[:format] || 'text'
  color = options[:color] || 'yellow'
  room = options[:room]

  if msg && room
    @client[room].send(
      user,
      msg,
      message_format: format,
      color: color
    )
  end
end