Class: SimpleInteractor
- Inherits:
-
Object
- Object
- SimpleInteractor
- Defined in:
- lib/simple_interactor.rb
Constant Summary collapse
- VERSION =
'1.0.0'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ SimpleInteractor
constructor
A new instance of SimpleInteractor.
Constructor Details
#initialize(args) ⇒ SimpleInteractor
Returns a new instance of SimpleInteractor.
13 14 15 16 17 18 |
# File 'lib/simple_interactor.rb', line 13 def initialize(args) args.each_with_index do |value, index| params_names = self.class.instance_variable_get(:@params_names) instance_variable_set("@#{params_names[index]}", value) end end |
Class Method Details
.expected_params(*params_names) ⇒ Object
5 6 7 |
# File 'lib/simple_interactor.rb', line 5 def self.expected_params(*params_names) instance_variable_set :@params_names, params_names end |
.perform(*args) ⇒ Object
9 10 11 |
# File 'lib/simple_interactor.rb', line 9 def self.perform(*args) new(args).perform end |