Class: C3po::Translator::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/c3po/translator/configuration.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.bing_api_keyObject

Returns the value of attribute bing_api_key.



9
10
11
# File 'lib/c3po/translator/configuration.rb', line 9

def bing_api_key
  @bing_api_key
end

.google_api_keyObject

Returns the value of attribute google_api_key.



9
10
11
# File 'lib/c3po/translator/configuration.rb', line 9

def google_api_key
  @google_api_key
end

.providerObject

Returns the value of attribute provider.



9
10
11
# File 'lib/c3po/translator/configuration.rb', line 9

def provider
  @provider
end

Class Method Details

.configure(&block) {|_self| ... } ⇒ Object

Define a configure block.

config.provider can be an Array. In this case, provider will be randomly choosen from it.

Examples:

Define the option.

C3po.configure do |config|
  config.provider = :google
  config.google_api_key = "MYAPIKEY"
end

Parameters:

  • block (Proc)

    The block getting called.

Yields:

  • (_self)

Yield Parameters:

Since:

  • 0.0.1



26
27
28
# File 'lib/c3po/translator/configuration.rb', line 26

def configure(&block)
  yield self
end