Class: Pipefitter::Inventory
- Inherits:
-
Object
- Object
- Pipefitter::Inventory
- Defined in:
- lib/pipefitter/inventory.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize(path) ⇒ Inventory
constructor
A new instance of Inventory.
- #put(key, value) ⇒ Object
Constructor Details
#initialize(path) ⇒ Inventory
Returns a new instance of Inventory.
8 9 10 11 |
# File 'lib/pipefitter/inventory.rb', line 8 def initialize(path) @path = path FileUtils.mkdir_p(path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/pipefitter/inventory.rb', line 6 def path @path end |
Instance Method Details
#get(key) ⇒ Object
18 19 20 |
# File 'lib/pipefitter/inventory.rb', line 18 def get(key) data[key] end |
#put(key, value) ⇒ Object
13 14 15 16 |
# File 'lib/pipefitter/inventory.rb', line 13 def put(key, value) data[key] = value save end |