Class: Kitchen::Driver::VmpoolStores::FileStore
- Inherits:
-
Object
- Object
- Kitchen::Driver::VmpoolStores::FileStore
- Defined in:
- lib/kitchen/driver/vmpool_stores/file_store.rb
Instance Attribute Summary collapse
-
#pool_file ⇒ Object
readonly
Returns the value of attribute pool_file.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(options = nil) ⇒ FileStore
constructor
A new instance of FileStore.
- #pool_data ⇒ Object
- #read ⇒ Object
- #save ⇒ Object
- #update(content) ⇒ Object
Constructor Details
#initialize(options = nil) ⇒ FileStore
Returns a new instance of FileStore.
11 12 13 14 15 |
# File 'lib/kitchen/driver/vmpool_stores/file_store.rb', line 11 def initialize( = nil) raise ArgumentError unless ['pool_file'] ||= { 'pool_file' => 'vmpool.yaml' } @pool_file = ['pool_file'] end |
Instance Attribute Details
#pool_file ⇒ Object (readonly)
Returns the value of attribute pool_file.
8 9 10 |
# File 'lib/kitchen/driver/vmpool_stores/file_store.rb', line 8 def pool_file @pool_file end |
Instance Method Details
#create ⇒ Object
22 23 24 25 |
# File 'lib/kitchen/driver/vmpool_stores/file_store.rb', line 22 def create write_content(base_content) read end |
#pool_data ⇒ Object
37 38 39 |
# File 'lib/kitchen/driver/vmpool_stores/file_store.rb', line 37 def pool_data @pool_data ||= YAML.load(read_content) end |
#read ⇒ Object
27 28 29 30 |
# File 'lib/kitchen/driver/vmpool_stores/file_store.rb', line 27 def read puts "Reading snippet" read_content end |
#save ⇒ Object
32 33 34 35 |
# File 'lib/kitchen/driver/vmpool_stores/file_store.rb', line 32 def save write_content read end |
#update(content) ⇒ Object
17 18 19 20 |
# File 'lib/kitchen/driver/vmpool_stores/file_store.rb', line 17 def update(content) write_content(content) read end |