Class: Ree::PackagesStore
Instance Attribute Summary collapse
-
#ree_version ⇒ Object
readonly
Returns the value of attribute ree_version.
Instance Method Summary collapse
- #add_package(package) ⇒ Object
- #get(name) ⇒ Ree::Package
-
#initialize(ree_version = Ree::VERSION) ⇒ PackagesStore
constructor
A new instance of PackagesStore.
- #packages ⇒ Object
- #set_ree_version(val) ⇒ Object
Constructor Details
#initialize(ree_version = Ree::VERSION) ⇒ PackagesStore
Returns a new instance of PackagesStore.
6 7 8 9 |
# File 'lib/ree/core/packages_store.rb', line 6 def initialize(ree_version = Ree::VERSION) @ree_version = ree_version @store = {} end |
Instance Attribute Details
#ree_version ⇒ Object (readonly)
Returns the value of attribute ree_version.
4 5 6 |
# File 'lib/ree/core/packages_store.rb', line 4 def ree_version @ree_version end |
Instance Method Details
#add_package(package) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/ree/core/packages_store.rb', line 26 def add_package(package) existing = get(package.name) return existing if existing @store[package.name] = package end |
#get(name) ⇒ Ree::Package
21 22 23 |
# File 'lib/ree/core/packages_store.rb', line 21 def get(name) @store[name] end |
#packages ⇒ Object
15 16 17 |
# File 'lib/ree/core/packages_store.rb', line 15 def packages @store.values end |
#set_ree_version(val) ⇒ Object
11 12 13 |
# File 'lib/ree/core/packages_store.rb', line 11 def set_ree_version(val) @ree_version = val; self end |