Sha256: 3d03d516f167729a7434e0f87dc7a3c0214afacc635850516a9482d1f35d71ef

Contents?: true

Size: 840 Bytes

Versions: 4

Compression:

Stored size: 840 Bytes

Contents

# frozen_string_literal: true

module Mock
  module Twilio
    module Generator
      def phone_number_generator
        "+1" + rand(100000000..999999999).to_s
      end

      def random_phone_number_sid
        random_sid_prefixed_by "PN"
      end

      def random_account_sid
        random_sid_prefixed_by "AC"
      end

      def random_twiml_app_sid
        random_sid_prefixed_by "AP"
      end

      def random_identity_sid
        random_sid_prefixed_by "RI"
      end

      def random_address_sid
        random_sid_prefixed_by "AD"
      end

      def random_bundle_sid
        random_sid_prefixed_by "BU"
      end

      def random_assignment_sid
        random_sid_prefixed_by "RA"
      end

      private

      def random_sid_prefixed_by(prefix)
        "#{prefix}#{SecureRandom.hex(16)}"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mock-twilio-1.4 lib/mock/twilio/util/generator.rb
mock-twilio-1.3.2 lib/mock/twilio/util/generator.rb
mock-twilio-1.3.1 lib/mock/twilio/util/generator.rb
mock-twilio-1.3.0 lib/mock/twilio/util/generator.rb