class Riveter::Service::Base

helper class

Public Class Methods

inherited(klass) click to toggle source
# File lib/riveter/service.rb, line 27
def inherited(klass)
  #
  # attempt to get the name of the command
  # from the derived classes name and register
  # it as the service handler for that command
  #
  # e.g. CreatePortfolioCommand ==> CreatePortfolioService
  #
  command_type = klass.name.gsub(/Service$/, 'Command').constantize rescue nil
  register_type klass, command_type unless command_type.nil?
end