Module: Capricorn::System::Helper

Included in:
Capricorn::System
Defined in:
lib/capricorn/system/helper.rb

Instance Method Summary collapse

Instance Method Details

#use(actor) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/capricorn/system/helper.rb', line 6

def use(actor)
  actor_klass  = (Capricorn::Actors.const_get(actor) rescue nil)
  raise "Actor not found! (#{actor})" unless actor_klass
  
  actor_helper = (actor_klass.const_get('Helper') rescue nil)
  extend actor_helper if actor_helper
  
  actor_config = (actor_klass.const_get('Config') rescue nil)
  extend actor_config if actor_config
  
  @actors.push(actor_klass)
end