Class: ExtremeAas::ExtremeAction

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/extreme_aas/extreme_action.rb

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



14
15
16
17
18
# File 'app/models/extreme_aas/extreme_action.rb', line 14

def method_missing(method, *args, &block)
  super
rescue NoMethodError => e
  self.actionable.send(method, *args, &block)
end

Class Method Details

.parse(args = {}) ⇒ Object



7
8
9
10
11
12
# File 'app/models/extreme_aas/extreme_action.rb', line 7

def self.parse args={}
  if args.include? :group
    return ExtremeActionGroup.find_by_name(args[:group]).super_action
  end
  return ExtremeSimpleAction.where(args).first.super_action
end