Class: LeanplumApi::Configuration

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

Constant Summary collapse

DEFAULT_LEANPLUM_API_VERSION =
'1.0.6'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



42
43
44
45
46
47
48
49
# File 'lib/leanplum_api/configuration.rb', line 42

def initialize
  @api_version = DEFAULT_LEANPLUM_API_VERSION
  @developer_mode = false
  @validate_response = true
  @timeout_seconds = 600
  @logger = LeanplumApi::Logger.new(STDOUT)
  @api_debug = debug_mode?
end

Instance Attribute Details

#api_debugObject

Optional



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

def api_debug
  @api_debug
end

#api_versionObject

Returns the value of attribute api_version.



27
28
29
# File 'lib/leanplum_api/configuration.rb', line 27

def api_version
  @api_version
end

#app_idObject

Required IDs and access keys provided by leanplum



19
20
21
# File 'lib/leanplum_api/configuration.rb', line 19

def app_id
  @app_id
end

#content_read_only_keyObject

Returns the value of attribute content_read_only_key.



21
22
23
# File 'lib/leanplum_api/configuration.rb', line 21

def content_read_only_key
  @content_read_only_key
end

#data_export_keyObject

Returns the value of attribute data_export_key.



22
23
24
# File 'lib/leanplum_api/configuration.rb', line 22

def data_export_key
  @data_export_key
end

#developer_modeObject

Returns the value of attribute developer_mode.



28
29
30
# File 'lib/leanplum_api/configuration.rb', line 28

def developer_mode
  @developer_mode
end

#development_keyObject

Returns the value of attribute development_key.



23
24
25
# File 'lib/leanplum_api/configuration.rb', line 23

def development_key
  @development_key
end

#loggerObject

Returns the value of attribute logger.



29
30
31
# File 'lib/leanplum_api/configuration.rb', line 29

def logger
  @logger
end

#production_keyObject

Returns the value of attribute production_key.



20
21
22
# File 'lib/leanplum_api/configuration.rb', line 20

def production_key
  @production_key
end

#s3_access_idObject

Returns the value of attribute s3_access_id.



38
39
40
# File 'lib/leanplum_api/configuration.rb', line 38

def s3_access_id
  @s3_access_id
end

#s3_access_keyObject

Returns the value of attribute s3_access_key.



39
40
41
# File 'lib/leanplum_api/configuration.rb', line 39

def s3_access_key
  @s3_access_key
end

#s3_bucket_nameObject

Optional configuration for exporting raw data to S3. If s3_bucket_name is provided, s3_access_id and s3_access_key must also be provided.



37
38
39
# File 'lib/leanplum_api/configuration.rb', line 37

def s3_bucket_name
  @s3_bucket_name
end

#s3_object_prefixObject

Returns the value of attribute s3_object_prefix.



40
41
42
# File 'lib/leanplum_api/configuration.rb', line 40

def s3_object_prefix
  @s3_object_prefix
end

#timeout_secondsObject

Returns the value of attribute timeout_seconds.



30
31
32
# File 'lib/leanplum_api/configuration.rb', line 30

def timeout_seconds
  @timeout_seconds
end

#validate_responseObject

Override validations for leanplum response. On by default.



33
34
35
# File 'lib/leanplum_api/configuration.rb', line 33

def validate_response
  @validate_response
end

Instance Method Details

#debug_mode?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/leanplum_api/configuration.rb', line 51

def debug_mode?
  ENV['LEANPLUM_API_DEBUG'].to_s =~ /^(true|t|yes|y|1)$/i
end