Sha256: 671b09ef3bdc007415ad45856257b0e02fc70bdf5d03e0eaed27fe89d512e659

Contents?: true

Size: 756 Bytes

Versions: 19

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true

module Script
  module Layers
    module Infrastructure
      class ExtensionPointRepository
        def get_extension_point(type)
          Domain::ExtensionPoint.new(type, fetch_extension_point(type))
        end

        def extension_point_types
          extension_points.keys
        end

        private

        def fetch_extension_point(type)
          raise Domain::Errors::InvalidExtensionPointError, type unless extension_points[type]
          extension_points[type]
        end

        def extension_points
          @extension_points ||= begin
            require 'yaml'
            YAML.load_file(Project.project_filepath('config/extension_points.yml'))
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
shopify-cli-1.5.0 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.4.1 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.4.0 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.3.1 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.3.0 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.2.0 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.1.2 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.1.1 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.1.0 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.0.5 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.0.4 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.0.3 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.0.2 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.0.1 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-1.0.0 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-0.9.3 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-0.9.2 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-0.9.1 lib/project_types/script/layers/infrastructure/extension_point_repository.rb
shopify-cli-0.9.0 lib/project_types/script/layers/infrastructure/extension_point_repository.rb