ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
lib/thinkst_canary/factory_generator.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module ThinkstCanary
  class FactoryGenerator
    include ThinkstCanary::APIQueryable

    def create_factory(memo:, flock_id:)
      params = { memo:, flock_id: }
      factory_auth = query(:post, '/api/v1/canarytoken/create_factory', params:)['factory_auth']
      ThinkstCanary::Factory.new(factory_auth:, **params)
    end
  end
end