Class: Line::Bot::Client

Inherits:
Object
  • Object
show all
Includes:
API
Defined in:
lib/line/bot/client.rb

Constant Summary

Constant Summary

Constants included from Constants

Line::Bot::Constants::POST_EVENT_API_CHANEL_ID

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from API::SendContent

#send_audio, #send_image, #send_location, #send_sticker, #send_text, #send_video

Methods included from API::GetContent

#get_message_content, #get_message_content_preview

Methods included from API::Profile

#get_profiles

Constructor Details

- (Client) initialize {|_self| ... }

Returns a new instance of Client

Yields:

  • (_self)

Yield Parameters:



10
11
12
# File 'lib/line/bot/client.rb', line 10

def initialize
  yield(self) if block_given?
end

Instance Attribute Details

- (Object) channel_id

Returns the value of attribute channel_id



8
9
10
# File 'lib/line/bot/client.rb', line 8

def channel_id
  @channel_id
end

- (Object) channel_mid

Returns the value of attribute channel_mid



8
9
10
# File 'lib/line/bot/client.rb', line 8

def channel_mid
  @channel_mid
end

- (Object) channel_secret

Returns the value of attribute channel_secret



8
9
10
# File 'lib/line/bot/client.rb', line 8

def channel_secret
  @channel_secret
end

Instance Method Details

- (Object) credentials



14
15
16
17
18
19
20
# File 'lib/line/bot/client.rb', line 14

def credentials
  {
    channel_id:     channel_id,
    channel_secret: channel_secret,
    channel_mid:    channel_mid
  }
end

- (Boolean) credentials?

Returns:

  • (Boolean)


22
23
24
# File 'lib/line/bot/client.rb', line 22

def credentials?
  credentials.values.all?
end

- (Object) user_agent



26
27
28
# File 'lib/line/bot/client.rb', line 26

def user_agent
  "LineBotGem/#{Line::Bot::VERSION}"
end