https://github.com/seandong/lark-ruby-sdk
Ruby SDKs for Lark(飞书) API https://open.feishu.cn/
https://github.com/seandong/lark-ruby-sdk
Last synced: about 2 months ago
JSON representation
Ruby SDKs for Lark(飞书) API https://open.feishu.cn/
- Host: GitHub
- URL: https://github.com/seandong/lark-ruby-sdk
- Owner: seandong
- License: mit
- Created: 2020-12-09T10:35:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-25T03:45:36.000Z (about 1 year ago)
- Last Synced: 2025-02-27T07:44:27.242Z (2 months ago)
- Language: Ruby
- Size: 118 KB
- Stars: 21
- Watchers: 5
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-feishu - seandong/lark-ruby-sdk - ruby-sdk) (社区资源 / SDK)
README
[](https://badge.fury.io/rb/lark-sdk)
> Ruby SDKs for Lark(飞书) API https://open.feishu.cn/
## 安装
Add this line to your application's Gemfile:
```ruby
gem 'lark-sdk'
```And then execute:
```ruby
$ bundle install
```Or install it yourself as:
```bash
$ gem install lark-sdk
``````ruby
require 'lark/sdk'
```## 使用
初始化:
```ruby
# config/initializers/lark.rbLark.configure do |config|
config.redis = Redis.new(url: 'redis://127.0.0.1:6379/1')
config.default_app_id = 'xxx' # 应用 app ID
config.default_app_secret = 'xxx' # 应用 app secret
config.default_isv = true # 自建应用: false, 应用商店应用: true
config.api_base_url = 'https://open.feishu.cn/open-apis/' # API 地址,默认:https://open.feishu.cn/open-apis/
# ...
end
```实例化 API:
```ruby
api = Lark::Api.new(
app_id: 'xxx', # default: Lark.config.default_app_id
app_secret: 'xxx', # default: Lark.config.default_app_secret
isv: false/true, # default: Lark.config.default_app_secret
tenant_key: 'xxx' # required while internal app
)
```加/解密:
```ruby
cipher = Lark::Cipher.new(encrypt_key)
# 解密
cipher.decrypt(message)# 加密
cipher.encrypt(message)
```[Api 列表](https://github.com/seandong/lark-ruby-sdk/wiki/apis)
## 贡献
如果你有好的意见或建议,欢迎给我们提issue或pull request。
## License
The MIT License(http://opensource.org/licenses/MIT)
请自由地享受和参与开源