Module: ActiveInteractor::Configurable

Included in:
Config, Interactor::PerformOptions, Rails::Config
Defined in:
lib/active_interactor/configurable.rb

Overview

Methods for configurable objects

Author:

Since:

  • 1.0.0

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Since:

  • 1.0.0


10
11
12
13
14
# File 'lib/active_interactor/configurable.rb', line 10

def self.included(base)
  base.class_eval do
    extend ClassMethods
  end
end

Instance Method Details

#initialize(options = {}) ⇒ Configurable

Returns a new instance of ActiveInteractor::Configurable.

Since:

  • 1.0.0


39
40
41
42
43
# File 'lib/active_interactor/configurable.rb', line 39

def initialize(options = {})
  self.class.defaults.merge(options).each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end