Class: Komonjo::Service::MessagesService

Inherits:
SlackService show all
Defined in:
lib/komonjo/services/messages_service.rb

Overview

A service for merge channel log and user information

Instance Method Summary collapse

Methods inherited from SlackService

#connection

Constructor Details

#initialize(api_token) ⇒ MessagesService

Returns a new instance of MessagesService.



5
6
7
# File 'lib/komonjo/services/messages_service.rb', line 5

def initialize(api_token)
  @api_token = api_token
end

Instance Method Details

#messages(opts) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/komonjo/services/messages_service.rb', line 9

def messages(opts)
  connection = connection(@api_token)
  history = connection.channels_history(opts)
  users = connection.users_list
  emojis = connection.emoji_list
  gateway = Komonjo::Gateway::MessagesGateway.new(history, users, emojis)
  gateway.messages
end