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:, api_url: 'https://engine.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)

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

    the API endpoint URL (default: ‘engine.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:



105
106
107
108
109
110
111
# File 'lib/lingodotdev.rb', line 105

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

Instance Attribute Details

#api_keyString

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_urlString

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_sizeInteger

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

Returns:

  • (Integer)

    maximum number of items per batch (1-250)



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

def batch_size
  @batch_size
end

#ideal_batch_item_sizeInteger

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

Returns:

  • (Integer)

    target word count per batch item (1-2500)



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

def ideal_batch_item_size
  @ideal_batch_item_size
end