Class: Packerman::Repository
- Inherits:
-
Object
- Object
- Packerman::Repository
- Defined in:
- lib/packerman/repository.rb
Constant Summary collapse
- ARRAY_ATTRIBUTES =
[:builders, :provisioners]
Class Method Summary collapse
Instance Method Summary collapse
- #add_variables(hash) ⇒ Object
-
#initialize ⇒ Repository
constructor
A new instance of Repository.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ Repository
Returns a new instance of Repository.
4 5 6 |
# File 'lib/packerman/repository.rb', line 4 def initialize @_repo = {} end |
Class Method Details
.gather ⇒ Object
27 28 29 30 31 32 |
# File 'lib/packerman/repository.rb', line 27 def gather yield @_current_instance.to_hash.tap do @_current_instance = nil end end |
.instance ⇒ Object
34 35 36 |
# File 'lib/packerman/repository.rb', line 34 def instance @_current_instance ||= new end |
Instance Method Details
#add_variables(hash) ⇒ Object
16 17 18 19 20 |
# File 'lib/packerman/repository.rb', line 16 def add_variables(hash) @_repo[:variables] ||= {} @_repo[:variables].merge!(hash) hash end |
#to_hash ⇒ Object
22 23 24 |
# File 'lib/packerman/repository.rb', line 22 def to_hash @_repo end |