Module: Injectable::InstanceMethods

Defined in:
lib/injectable/instance_methods.rb

Instance Method Summary collapse

Instance Method Details

#call(args = {}) ⇒ Object

Entry point of the service. Arguments for this method should be declared explicitly with ‘.argument’ and declare this method without arguments



14
15
16
17
18
19
# File 'lib/injectable/instance_methods.rb', line 14

def call(args = {})
  check_call_definition!
  check_missing_arguments!(self.class.required_call_arguments, args)
  variables_for!(self.class.call_arguments, args)
  super()
end

#initialize(args = {}) ⇒ Object

Initialize the service with the dependencies injected



4
5
6
7
8
9
# File 'lib/injectable/instance_methods.rb', line 4

def initialize(args = {})
  check_missing_arguments!(self.class.required_initialize_arguments, args)
  variables_for!(self.class.initialize_arguments, args)
  variables_from_dependencies!(args)
  super()
end