Sha256: c4db47dd435572e0a6b28b776e9edb0525c737b6dd2fa5b08c632f26cebfcf6b

Contents?: true

Size: 807 Bytes

Versions: 7

Compression:

Stored size: 807 Bytes

Contents

module Spree
  module Admin
    module MainMenu
      class ItemBuilder
        include ::Spree::Admin::PermissionChecks

        def initialize(key, url)
          @key = key
          @label_translation_key = key
          @url = url
          @icon_key = nil
          @availability_checks = []
          @match_path = nil
        end

        def with_label_translation_key(key)
          @label_translation_key = key
          self
        end

        def with_icon_key(icon_key)
          @icon_key = icon_key
          self
        end

        def with_match_path(match_path)
          @match_path = match_path
          self
        end

        def build
          Item.new(@key, @label_translation_key, @url, @icon_key, @availability_checks, @match_path)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spree_backend-4.8.4 app/models/spree/admin/main_menu/item_builder.rb
spree_backend-4.8.3 app/models/spree/admin/main_menu/item_builder.rb
spree_backend-4.8.2 app/models/spree/admin/main_menu/item_builder.rb
spree_backend-4.8.1 app/models/spree/admin/main_menu/item_builder.rb
spree_backend-4.7.2 app/models/spree/admin/main_menu/item_builder.rb
spree_backend-4.7.1 app/models/spree/admin/main_menu/item_builder.rb
spree_backend-4.7.0 app/models/spree/admin/main_menu/item_builder.rb