Class: Stockboy::Configuration
- Inherits:
-
Object
- Object
- Stockboy::Configuration
- Defined in:
- lib/stockboy/configuration.rb
Overview
Global Stockboy configuration options
Instance Attribute Summary collapse
-
#logger ⇒ Logger
Default logger.
-
#template_load_paths ⇒ Array<String>
Directories where Stockboy job template files can be found.
-
#tmp_dir ⇒ String
Path for storing tempfiles during processing.
-
#translation_error_handler ⇒ Object
To allow inspection when tranlastion error occurs.
Instance Method Summary collapse
-
#initialize { ... } ⇒ Configuration
constructor
Initialize a set of global configuration options.
Constructor Details
#initialize { ... } ⇒ Configuration
Initialize a set of global configuration options
41 42 43 44 45 46 47 |
# File 'lib/stockboy/configuration.rb', line 41 def initialize @template_load_paths = [] @logger = Logger.new(STDOUT) @tmp_dir = Dir.tmpdir @translation_error_handler = ->(error) { nil } yield self if block_given? end |
Instance Attribute Details
#logger ⇒ Logger
Default logger
28 29 30 |
# File 'lib/stockboy/configuration.rb', line 28 def logger @logger end |
#template_load_paths ⇒ Array<String>
Directories where Stockboy job template files can be found.
Needs to be configured with your own paths if running standalone. When running with Rails, includes config/stockboy_jobs
by default.
16 17 18 |
# File 'lib/stockboy/configuration.rb', line 16 def template_load_paths @template_load_paths end |
#tmp_dir ⇒ String
Path for storing tempfiles during processing
22 23 24 |
# File 'lib/stockboy/configuration.rb', line 22 def tmp_dir @tmp_dir end |
#translation_error_handler ⇒ Object
To allow inspection when tranlastion error occurs
By default returns nil on error but can be overridden
33 34 35 |
# File 'lib/stockboy/configuration.rb', line 33 def translation_error_handler @translation_error_handler end |