Class: Pokotarou::HandlerFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/pokotarou/handler_factory.rb

Class Method Summary collapse

Class Method Details

.gen_handler(filepath) ⇒ Object



8
9
10
11
12
# File 'lib/pokotarou/handler_factory.rb', line 8

def gen_handler filepath
  AdditionalMethods::Main.init()
  
  Handler.new(gen_config(filepath))
end

.gen_handler_with_cache(filepath) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/pokotarou/handler_factory.rb', line 14

def gen_handler_with_cache filepath
  AdditionalMethods::Main.init()
  
  @handler_cache ||= {}
  @handler_cache[filepath] ||= Handler.new(gen_config(filepath))
  
  @handler_cache[filepath].deep_dup
end