Class: Hws::Connectors::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/hws-connectors/base.rb

Constant Summary collapse

ALLOWED_ACTION_CLASSES =
[String, Symbol].freeze

Class Method Summary collapse

Class Method Details

.execute_action(action, *args) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/hws-connectors/base.rb', line 4

def self.execute_action action, *args
  return nil unless ALLOWED_ACTION_CLASSES.include?(action.class)

  action = action.to_sym
  return nil unless self.methods.include?(action)

  self.send(action, *args)
end