Class: Peach
- Inherits:
-
Object
- Object
- Peach
- Defined in:
- lib/peach.rb
Instance Method Summary collapse
Instance Method Details
#createDevices(peachFile = 'peach.yml') ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/peach.rb', line 12 def createDevices(peachFile = 'peach.yml') xc = XC.new peaches = YAML.load_file(peachFile) peaches.each do |properties| peach_name = properties["name"] peach_device = properties["device_type"] peach_runtime = properties["runtime"] peach = Device.new(name: peach_name, device_type: peach_device, runtime: peach_runtime, xc: xc) peach.create() unless peach.exists? end end |
#destroy_all ⇒ Object
8 9 10 |
# File 'lib/peach.rb', line 8 def destroy_all Device.destroy_all(xc: XC.new) end |