Sha256: e885c1b4c3f67660b3e1ab4a7377d95f38ba744a95af9d833fe93ae467fe788b

Contents?: true

Size: 557 Bytes

Versions: 33

Compression:

Stored size: 557 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

33 entries across 33 versions & 1 rubygems

Version Path
ree-1.0.32 lib/ree/core/packages_store.rb
ree-1.0.31 lib/ree/core/packages_store.rb
ree-1.0.30 lib/ree/core/packages_store.rb
ree-1.0.29 lib/ree/core/packages_store.rb
ree-1.0.28 lib/ree/core/packages_store.rb
ree-1.0.27 lib/ree/core/packages_store.rb
ree-1.0.26 lib/ree/core/packages_store.rb
ree-1.0.25 lib/ree/core/packages_store.rb
ree-1.0.24 lib/ree/core/packages_store.rb
ree-1.0.23 lib/ree/core/packages_store.rb
ree-1.0.22 lib/ree/core/packages_store.rb
ree-1.0.21 lib/ree/core/packages_store.rb
ree-1.0.20 lib/ree/core/packages_store.rb
ree-1.0.19 lib/ree/core/packages_store.rb
ree-1.0.18 lib/ree/core/packages_store.rb
ree-1.0.17 lib/ree/core/packages_store.rb
ree-1.0.16 lib/ree/core/packages_store.rb
ree-1.0.15 lib/ree/core/packages_store.rb
ree-1.0.14 lib/ree/core/packages_store.rb
ree-1.0.13 lib/ree/core/packages_store.rb