Class: Hyrum::Generators::MessageGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/hyrum/generators/message_generator.rb

Class Method Summary collapse

Class Method Details

.create(options) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/hyrum/generators/message_generator.rb', line 20

def self.create(options)
  unless GENERATOR_CLASSES.key?(options[:ai_service].to_sym)
    raise ArgumentError, "Invalid AI service: #{options[:ai_service]}"
  end

  generator_class = GENERATOR_CLASSES[options[:ai_service].to_sym]
  generator_class.new(options)
end