Module: Monkeylearn::Defaults

Defined in:
lib/monkeylearn/defaults.rb

Constant Summary collapse

DEFAULT_BATCH_SIZE =

Constants

200
MAX_BATCH_SIZE =
200
BASE_URL =

Configurable options

'https://api.monkeylearn.com/v3/'
RETRY_IF_THROTTLE =
true
AUTO_BATCH =
true

Class Method Summary collapse

Class Method Details

.auto_batchObject



28
29
30
# File 'lib/monkeylearn/defaults.rb', line 28

def auto_batch
  boolean_setting('MONKEYLEARN_AUTO_BATCH', AUTO_BATCH)
end

.base_urlObject



16
17
18
# File 'lib/monkeylearn/defaults.rb', line 16

def base_url
  ENV['MONKEYLEARN_API_BASE_URL'] || BASE_URL
end

.default_batch_sizeObject



36
37
38
# File 'lib/monkeylearn/defaults.rb', line 36

def default_batch_size
  DEFAULT_BATCH_SIZE
end

.max_batch_sizeObject



32
33
34
# File 'lib/monkeylearn/defaults.rb', line 32

def max_batch_size
  MAX_BATCH_SIZE
end

.optionsObject



12
13
14
# File 'lib/monkeylearn/defaults.rb', line 12

def options
  Hash[Monkeylearn::Configurable.keys.map{|key| [key, send(key)]}]
end

.retry_if_throttleObject



24
25
26
# File 'lib/monkeylearn/defaults.rb', line 24

def retry_if_throttle
  boolean_setting('MONKEYLEARN_RETRY_IF_THROTTLE', RETRY_IF_THROTTLE)
end

.tokenObject



20
21
22
# File 'lib/monkeylearn/defaults.rb', line 20

def token
  ENV['MONKEYLEARN_TOKEN'] || nil
end