Sha256: 9514743e72d64669616be3a9adfa205dd6dbba5bad769423102179b8a9b86aa3

Contents?: true

Size: 804 Bytes

Versions: 9

Compression:

Stored size: 804 Bytes

Contents

# frozen_string_literal: true

class GlobalID
  module FixtureSet
    def global_id(fixture_set_name, label, column_type: :integer, **options)
      create_global_id(fixture_set_name, label, column_type: column_type, klass: GlobalID, **options)
    end

    def signed_global_id(fixture_set_name, label, column_type: :integer, **options)
      create_global_id(fixture_set_name, label, column_type: column_type, klass: SignedGlobalID, **options)
    end

    private
      def create_global_id(fixture_set_name, label, klass:, column_type: :integer, **options)
        identifier = identify(label, column_type)
        model_name = default_fixture_model_name(fixture_set_name)
        uri = URI::GID.build([GlobalID.app, model_name, identifier, {}])
        klass.new(uri, **options)
      end
  end
end

Version data entries

9 entries across 9 versions & 5 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/globalid-1.2.1/lib/global_id/fixture_set.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/globalid-1.2.1/lib/global_id/fixture_set.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/globalid-1.2.1/lib/global_id/fixture_set.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/globalid-1.2.1/lib/global_id/fixture_set.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/globalid-1.2.1/lib/global_id/fixture_set.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/globalid-1.2.1/lib/global_id/fixture_set.rb
globalid-1.2.1 lib/global_id/fixture_set.rb
globalid-1.2.0 lib/global_id/fixture_set.rb
globalid-1.1.0 lib/global_id/fixture_set.rb