Sha256: 258872e6e8cbc6b0f62de352570c0fcb33bcc4a7ab9959cba4320c4cc73beff7

Contents?: true

Size: 684 Bytes

Versions: 20

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true
require 'shopify_cli'

module Extension
  module Tasks
    module Converters
      module RegistrationConverter
        ID_FIELD = 'id'
        TYPE_FIELD = 'type'
        TITLE_FIELD = 'title'
        DRAFT_VERSION_FIELD = 'draftVersion'

        def self.from_hash(context, hash)
          context.abort(context.message('tasks.errors.parse_error')) if hash.nil?

          Models::Registration.new(
            id: hash[ID_FIELD].to_i,
            type: hash[TYPE_FIELD],
            title: hash[TITLE_FIELD],
            draft_version: VersionConverter.from_hash(context, hash[DRAFT_VERSION_FIELD])
          )
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shopify-cli-1.6.0 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.5.0 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.4.1 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.4.0 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.3.1 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.3.0 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.2.0 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.1.2 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.1.1 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.1.0 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.0.5 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.0.4 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.0.3 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.0.2 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.0.1 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-1.0.0 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-0.9.3 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-0.9.2 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-0.9.1 lib/project_types/extension/tasks/converters/registration_converter.rb
shopify-cli-0.9.0 lib/project_types/extension/tasks/converters/registration_converter.rb