Module: NxtSupport::Services::Base::ClassMethods

Defined in:
lib/nxt_support/services/base.rb

Instance Method Summary collapse

Instance Method Details

#class_interface(config = :call) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/nxt_support/services/base.rb', line 5

def class_interface(config = :call)
  if config.is_a?(Symbol)
    define_singleton_method config do |*args, **opts|
      build_instance(*args, **opts).send(config)
    end
  else
    raise ArgumentError, "Wrong configuration. Please use 'class_interface :your_method_name'"
  end
end