Class: Hvor::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
10
11
12
13
14
15
16
# File 'lib/hvor/configuration.rb', line 7

def initialize
  @api_token = nil
  @ipv4_product_code = "DB1LITECSV"
  @ipv6_product_code = "DB1LITECSVIPV6"
  @cache_store = -> { Rails.cache }
  @cache_expires_in = 24.hours
  @import_batch_size = 5_000
  @download_timeout = 60
  @queue_name = :hvor
end

Instance Attribute Details

#api_tokenObject

Returns the value of attribute api_token.



3
4
5
# File 'lib/hvor/configuration.rb', line 3

def api_token
  @api_token
end

#cache_expires_inObject

Returns the value of attribute cache_expires_in.



3
4
5
# File 'lib/hvor/configuration.rb', line 3

def cache_expires_in
  @cache_expires_in
end

#cache_storeObject

Returns the value of attribute cache_store.



3
4
5
# File 'lib/hvor/configuration.rb', line 3

def cache_store
  @cache_store
end

#download_timeoutObject

Returns the value of attribute download_timeout.



3
4
5
# File 'lib/hvor/configuration.rb', line 3

def download_timeout
  @download_timeout
end

#import_batch_sizeObject

Returns the value of attribute import_batch_size.



3
4
5
# File 'lib/hvor/configuration.rb', line 3

def import_batch_size
  @import_batch_size
end

#ipv4_product_codeObject

Returns the value of attribute ipv4_product_code.



3
4
5
# File 'lib/hvor/configuration.rb', line 3

def ipv4_product_code
  @ipv4_product_code
end

#ipv6_product_codeObject

Returns the value of attribute ipv6_product_code.



3
4
5
# File 'lib/hvor/configuration.rb', line 3

def ipv6_product_code
  @ipv6_product_code
end

#queue_nameObject

Returns the value of attribute queue_name.



3
4
5
# File 'lib/hvor/configuration.rb', line 3

def queue_name
  @queue_name
end

Instance Method Details

#cacheObject



18
19
20
# File 'lib/hvor/configuration.rb', line 18

def cache
  cache_store.call
end