require 'vagrant-skytap/api/resource' module VagrantPlugins module Skytap module API class PublishSet < Resource attr_reader :environment reads :id, :url, :desktops_url def initialize(attrs, environment, env) super @environment = environment end def password_protected? # password attribute contains asterisks or null get_api_attribute('password').present? end def vm_ids vm_refs = get_api_attribute("vms").collect{|ref| ref['vm_ref']} vm_refs.collect{|ref| ref.match(/\/vms\/(\d+)/)}.compact.map{|match| match[1]} end def vms environment.get_vms_by_id(vm_ids) end def delete api_client.delete(url) end end end end end