Class: LingoDotDev::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/lingodotdev.rb

Overview

Configuration for the Lingo.dev Engine.

Holds API credentials and batch processing settings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, engine_id: nil, api_url: 'https://api.lingo.dev', batch_size: 25, ideal_batch_item_size: 250) ⇒ Configuration

Creates a new Configuration instance.

Parameters:

  • api_key (String) —

    your Lingo.dev API key (required)

  • engine_id (String, nil) (defaults to: nil) —

    the engine ID for localization processing (optional)

  • api_url (String) (defaults to: 'https://api.lingo.dev') —

    the API endpoint URL (default: 'https://api.lingo.dev')

  • batch_size (Integer) (defaults to: 25) —

    maximum items per batch, 1-250 (default: 25)

  • ideal_batch_item_size (Integer) (defaults to: 250) —

    target word count per batch item, 1-2500 (default: 250)

Raises:



109
110
111
112
113
114
115
116
# File 'lib/lingodotdev.rb', line 109

def initialize(api_key:, engine_id: nil, api_url: 'https://api.lingo.dev', batch_size: 25, ideal_batch_item_size: 250)
  @api_key = api_key
  @engine_id = engine_id
  @api_url = api_url
  @batch_size = batch_size
  @ideal_batch_item_size = ideal_batch_item_size
  validate!
end

Instance Attribute Details

#api_key ⇒ String

Returns the Lingo.dev API key.

Returns:

  • (String) —

    the Lingo.dev API key



86
87
88
# File 'lib/lingodotdev.rb', line 86

def api_key
  @api_key
end

#api_url ⇒ String

Returns the API endpoint URL.

Returns:

  • (String) —

    the API endpoint URL



89
90
91
# File 'lib/lingodotdev.rb', line 89

def api_url
  @api_url
end

#batch_size ⇒ Integer

Returns maximum number of items per batch (1-250).

Returns:

  • (Integer) —

    maximum number of items per batch (1-250)



95
96
97
# File 'lib/lingodotdev.rb', line 95

def batch_size
  @batch_size
end

#engine_id ⇒ String?

Returns the engine ID for localization processing.

Returns:

  • (String, nil) —

    the engine ID for localization processing



92
93
94
# File 'lib/lingodotdev.rb', line 92

def engine_id
  @engine_id
end

#ideal_batch_item_size ⇒ Integer

Returns target word count per batch item (1-2500).

Returns:

  • (Integer) —

    target word count per batch item (1-2500)



98
99
100
# File 'lib/lingodotdev.rb', line 98

def ideal_batch_item_size
  @ideal_batch_item_size
end