Class: Ruboty::Adapters::Chiwawa

Inherits:
Base
  • Object
show all
Defined in:
lib/ruboty/adapters/cww.rb

Instance Method Summary collapse

Instance Method Details

#runObject



17
18
19
20
# File 'lib/ruboty/adapters/cww.rb', line 17

def run
  init
  listen
end

#say(message) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/ruboty/adapters/cww.rb', line 22

def say(message)
  url = URI.parse(message_endpoint_path)
  req = Net::HTTP::Post.new(url.path, headers)
  req.body = JSON.generate(post_message_data(message))
  https = Net::HTTP.new(url.host, access_port)
  https.use_ssl = true
  res = https.start { |https| https.request(req) }
end