Module: Baidu::Configure
- Included in:
- Baidu
- Defined in:
- lib/baidu/pcs.rb,
lib/baidu/configure.rb
Instance Attribute Summary collapse
-
#client_id ⇒ String
申请创建应用后获取的 API Key.
-
#client_secret ⇒ String
申请创建应用后获取的 Secret Key.
-
#debug ⇒ Boolean
用来控制是否在终端输出调试信息,主要涉及网络请求部分(Net::HTTP).
-
#pcs_dir_name ⇒ String
全局配置 PCS 的文件目录.
Instance Method Summary collapse
-
#config {|c| ... } ⇒ Configure
通过 block 进行 API 配置.
Instance Attribute Details
#client_id ⇒ String
申请创建应用后获取的 API Key
5 6 7 |
# File 'lib/baidu/configure.rb', line 5 def client_id @client_id end |
#client_secret ⇒ String
申请创建应用后获取的 Secret Key
9 10 11 |
# File 'lib/baidu/configure.rb', line 9 def client_secret @client_secret end |
#debug ⇒ Boolean
Note:
请勿在生产环境中打开
用来控制是否在终端输出调试信息,主要涉及网络请求部分(Net::HTTP)
14 15 16 |
# File 'lib/baidu/configure.rb', line 14 def debug @debug end |
#pcs_dir_name ⇒ String
全局配置 PCS 的文件目录
17 18 19 |
# File 'lib/baidu/pcs.rb', line 17 def pcs_dir_name @pcs_dir_name end |
Instance Method Details
#config {|c| ... } ⇒ Configure
通过 block 进行 API 配置
21 22 23 24 25 |
# File 'lib/baidu/configure.rb', line 21 def config self.debug = false # 默认 false yield self self end |