Module: Cosmo::ActiveJobAdapter::Options::ClassMethods
- Defined in:
- lib/cosmo/active_job/options.rb
Instance Method Summary collapse
-
#cosmo_options(**opts) ⇒ Object
Set Cosmo-specific options for this job class.
-
#get_cosmo_options ⇒ Object
Returns the resolved options, walking up the inheritance chain.
Instance Method Details
#cosmo_options(**opts) ⇒ Object
Set Cosmo-specific options for this job class. Merges with any options inherited from a superclass. Raises ArgumentError for unknown keys.
30 31 32 33 34 35 |
# File 'lib/cosmo/active_job/options.rb', line 30 def (**opts) unknown = opts.keys - Cosmo::ActiveJobAdapter::Options::VALID_OPTIONS raise ::ArgumentError, "Unknown cosmo_options key(s): #{unknown.join(", ")}" if unknown.any? @cosmo_options = .merge(opts) end |
#get_cosmo_options ⇒ Object
Returns the resolved options, walking up the inheritance chain.
38 39 40 41 42 43 44 45 46 |
# File 'lib/cosmo/active_job/options.rb', line 38 def # rubocop:disable Naming/AccessorMethodName if @cosmo_options @cosmo_options.dup elsif superclass.respond_to?(:get_cosmo_options) superclass. else {} end end |