Module: S3PO

Defined in:
lib/s-3po.rb,
lib/s-3po/events.rb,
lib/s-3po/parser.rb,
lib/s-3po/generator.rb

Defined Under Namespace

Classes: Event, Generator, Message, Parser, Response

Class Method Summary collapse

Class Method Details

.generate_message(message = {}) ⇒ String

Generate JSON message to send to Slack.


20
21
22
23
24
25
26
# File 'lib/s-3po.rb', line 20

def self.generate_message(message = {})
  if block_given?
    message = Message.new(message)
    yield message
  end
  return Generator.generate_message(message)
end

.generate_pingString

Generate JSON ping to send to Slack.


30
31
32
# File 'lib/s-3po.rb', line 30

def self.generate_ping
  return Generator.generate_ping()
end

.parse_event(event, opts = {}) ⇒ Object

Parse Slack event into an S3PO Event object.


12
13
14
# File 'lib/s-3po.rb', line 12

def self.parse_event(event, opts = {})
  return Parser.parse_event(event, opts)
end