Module: Kamigo::Clients::LineClient

Included in:
EventParsers::LineEventParser, EventResponsers::LineEventResponser
Defined in:
lib/kamigo/clients/line_client.rb

Instance Method Summary collapse

Instance Method Details

#clientObject



4
5
6
7
8
9
# File 'lib/kamigo/clients/line_client.rb', line 4

def client
  @client ||= Line::Bot::Client.new do |config|
    config.channel_secret = ENV['LINE_CHANNEL_SECRET']
    config.channel_token = ENV['LINE_CHANNEL_TOKEN']
  end
end

#validate_signature(request, body) ⇒ Object



11
12
13
14
# File 'lib/kamigo/clients/line_client.rb', line 11

def validate_signature(request, body)
  signature = request.env['HTTP_X_LINE_SIGNATURE']
  client.validate_signature(body, signature)
end