Module: WithdrawalDelegation::Klass

Defined in:
app/delegations/withdrawal_delegation.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *args) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'app/delegations/withdrawal_delegation.rb', line 3

def method_missing(method_sym, *args)
  scope = method_sym.to_s.upcase
  if WithdrawalConstants.constants.include?(scope.to_sym)
    scope_value = const_get scope
    if scope.split(/_/)[0] == 'STATUS'
      return where(status: scope_value)
    end
  end
  super
end