Module: Availability::FactoryMethods
- Included in:
- Availability, AbstractAvailability
- Defined in:
- lib/availability/factory_methods.rb
Instance Method Summary collapse
Instance Method Details
#create(**args) ⇒ Object
3 4 5 6 7 |
# File 'lib/availability/factory_methods.rb', line 3 def create(**args) cls = args.delete(:event_class) || Availability::subclass_for(args.delete(:frequency) || :daily) raise ArgumentError, "undefined frequency" if cls.nil? cls.send :new, **args end |