Module: YoudaoFanyi
- Defined in:
- lib/youdao_fanyi/configuration.rb,
lib/youdao_fanyi.rb,
lib/youdao_fanyi/errors.rb,
lib/youdao_fanyi/version.rb,
lib/youdao_fanyi/connector.rb,
lib/youdao_fanyi/translator.rb
Overview
Defined Under Namespace
Modules: Errors
Classes: Connector, InstallGenerator, Translator
Constant Summary
collapse
- VERSION =
"0.1.2.2"
- Configuration =
Struct.new(
:api_keys,
:http_proxy
).new(
[{ "keyfrom" => "test.vkill.net", "key" => "1234567890" }],
nil
)
Class Method Summary
collapse
Class Method Details
.api_key ⇒ Object
29
30
31
|
# File 'lib/youdao_fanyi.rb', line 29
def self.api_key
YoudaoFanyi::Configuration.api_keys.sort_by!{rand()}.first
end
|
19
20
21
22
|
# File 'lib/youdao_fanyi.rb', line 19
def self.configure
yield Configuration
reload!
end
|
.reload! ⇒ Object
24
25
26
27
|
# File 'lib/youdao_fanyi.rb', line 24
def self.reload!
load "youdao_fanyi/connector.rb"
load "youdao_fanyi/translator.rb"
end
|