Sha256: 68539d5ff3dfd5c8bd7569bf5bfe00e0c112f3edc2fea1a84cb9a304d4b96d12

Contents?: true

Size: 549 Bytes

Versions: 15

Compression:

Stored size: 549 Bytes

Contents

# frozen_string_literal: true

class Ree::PackagesStore
  attr_reader :ree_version

  def initialize(ree_version = Ree::VERSION)
    @ree_version = ree_version
    @store = {}
  end

  def set_ree_version(val)
    @ree_version = val; self
  end

  def packages
    @store.values
  end

  # @param [Symbol] name
  # @return [Ree::Package]
  def get(name)
    @store[name]
  end

  # @param [Ree::Package] package
  def add_package(package)
    existing = get(package.name)
    return existing if existing

    @store[package.name] = package
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ree-1.0.47 lib/ree/core/packages_store.rb
ree-1.0.46 lib/ree/core/packages_store.rb
ree-1.0.45 lib/ree/core/packages_store.rb
ree-1.0.44 lib/ree/core/packages_store.rb
ree-1.0.43 lib/ree/core/packages_store.rb
ree-1.0.42 lib/ree/core/packages_store.rb
ree-1.0.41 lib/ree/core/packages_store.rb
ree-1.0.40 lib/ree/core/packages_store.rb
ree-1.0.39 lib/ree/core/packages_store.rb
ree-1.0.38 lib/ree/core/packages_store.rb
ree-1.0.37 lib/ree/core/packages_store.rb
ree-1.0.36 lib/ree/core/packages_store.rb
ree-1.0.35 lib/ree/core/packages_store.rb
ree-1.0.34 lib/ree/core/packages_store.rb
ree-1.0.33 lib/ree/core/packages_store.rb