Module: Lark

Defined in:
lib/lark.rb,
lib/lark/api.rb,
lib/lark/cipher.rb,
lib/lark/config.rb,
lib/lark/helper.rb,
lib/lark/request.rb,
lib/lark/version.rb,
lib/lark/apis/bot.rb,
lib/lark/apis/pay.rb,
lib/lark/apis/auth.rb,
lib/lark/apis/chat.rb,
lib/lark/apis/mina.rb,
lib/lark/apis/user.rb,
lib/lark/apis/image.rb,
lib/lark/apis/authen.rb,
lib/lark/apis/notify.rb,
lib/lark/apis/search.rb,
lib/lark/apis/contact.rb,
lib/lark/apis/message.rb,
lib/lark/apis/drive/file.rb,
lib/lark/apis/application.rb,
lib/lark/apis/interactive.rb,
lib/lark/token_store/base.rb,
lib/lark/apis/drive/folder.rb,
lib/lark/apis/drive/platform.rb,
lib/lark/token_store/app_token.rb,
lib/lark/token_store/tenant_token.rb,
lib/lark/token_store/isv_app_token.rb,
lib/lark/token_store/isv_tenant_token.rb

Defined Under Namespace

Modules: Apis, Helper, TokenStore Classes: AccessTokenExpiredError, Api, AppNotConfigException, Cipher, Config, RedisNotConfigException, Request, ResponseError, Result, ResultErrorException

Constant Summary collapse

VERSION =
'1.2.2'.freeze

Class Method Summary collapse

Class Method Details

.api_base_urlObject



29
30
31
32
33
# File 'lib/lark/config.rb', line 29

def api_base_url
  return @api_base_url if defined?(@api_base_url)

  @api_base_url = config.api_base_url || 'https://open.feishu.cn/open-apis/'.freeze
end

.configObject



9
10
11
# File 'lib/lark/config.rb', line 9

def config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ Object

Yields:



5
6
7
# File 'lib/lark/config.rb', line 5

def configure
  yield config
end

.http_timeout_optionsObject



25
26
27
# File 'lib/lark/config.rb', line 25

def http_timeout_options
  config.http_timeout_options || { write: 2, connect: 5, read: 10 }
end

.loggerObject



17
18
19
20
21
22
23
# File 'lib/lark/config.rb', line 17

def logger
  @logger ||= if config.logger.nil?
                defined?(Rails) && Rails.logger ? Rails.logger : Logger.new(STDOUT)
              else
                config.logger
              end
end

.redisObject



13
14
15
# File 'lib/lark/config.rb', line 13

def redis
  config.redis
end